From: Kirill Marchuk <62mkv@mail.ru>
To: git@vger.kernel.org
Subject: very weird behaviour with "merge -s subtree"
Date: Wed, 25 Mar 2015 18:55:23 +0600 [thread overview]
Message-ID: <5512B03B.9020707@mail.ru> (raw)
Hi everyone
I'm totally stuck with a following problem:
- we have a repo, which contains several projects as folders - like
"api", "adminUI", "android", "web" - etc. Some parts are backend, some
frontend. Lets name these parts "details", as they constitute details of
the project in general.
- we would like to deploy via git, so as to minimize effort on
deployment (and automate it later).
- but every project is deployed separately.
From all I've read so far, I came to conclusion that "merge -s subtree"
seems to be done with this thing in mind, although scenarios,
described in articles like this one
(https://www.kernel.org/pub/software/scm/git/docs/howto/using-merge-subtree.html)
usually take only one part of it: merge from "detail" to "common", and
not vice versa.
So, what am I trying to: to implement a stable workflow, that would
allow me to easily merge changes from "develop" in "common" repo to a
"subtree-branch" and push to a corresponding "detail" remote.
What I am doing:
1) say, we have a folder "adminUI" in the root of "common" repo, branch
"test" (it's a snapshot branch for test environment - all deploys should
start here)
2) git remote add adminui-origin <path>
3) git fetch adminui-origin
4) git checkout -B test-adminui adminui-origin/test
(above steps are taken from
http://git-scm.com/book/en/v1/Git-Tools-Subtree-Merging)
5) git checkout test
6) git merge -s ours --no-commit test-adminui
(this one is from
https://www.kernel.org/pub/software/scm/git/docs/howto/using-merge-subtree.html)
7) git read-tree --prefix=adminUI/ -u test-adminui
Here I always get error like:
error: Entry 'adminUI/.gitignore' overlaps with 'adminUI/.gitignore'.
Cannot bind.
8) so, I have to rename folder "adminUI" to, like, "adminUI2", then "git
commit -a", then step 7 again
9) ok, so now I have a whole content of "adminui-origin" in folder
"/adminUI" in branch "test" of my "common" repo.
10) then I merge changes from "develop", which I want to deploy: git
merge develop
11) then I want to merge those changes "down the line" into "detail" repo:
git checkout test-adminui
git merge -s subtree test
12) for the first time, everything seems fine - only relevant changes
(i.e., changes in adminUI folder) are merged, and they go straight into
their right places (i.e., with respect to folder structure difference
between "common" and "detail")
13) git push adminui-origin test-adminui:test - this works good
14) let's say something else was updated in develop:
git checkout test
git merge develop
git checkout test-adminui
15) AND HERE BEGINS THE HELL:
git merge -s subtree test => leads to ALL of my working directory being
copied to a 3rd level folder somewhere in the adminUI depths !!!
This drives me TOTALLY insane, and I very much need help !!
I use msysgit 1.9.4 on Windows 8.1
I suspect that it might have to do with the repository structure, maybe
some errors, etc..
But I believe that it might be due to my total misunderstanding of something
Anyway, I totally appreciate your help !
Thanks a lot
Kirill, frustrated unexperienced git user...
next reply other threads:[~2015-03-25 13:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-25 12:55 Kirill Marchuk [this message]
2015-03-26 11:08 ` very weird behaviour with Kirill Marchuk
2015-03-27 10:58 ` Kirill Marchuk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5512B03B.9020707@mail.ru \
--to=62mkv@mail.ru \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).