Re: merge renamed files/directories?
- From
Shawn O. Pearce <spearce@spearce.org>
- Date
- May 6, 2008, 01:46 UTC
- Message-ID
- <20080506014636.GM29038@spearce.org>
- In-Reply-To
- <32541b130805051838k367c44bau715774b46f7894cb@mail.gmail.com>
Avery Pennarun <apenwarr@gmail.com> wrote:
Show 15 quoted lines
> > I have a branch called 'mylib' with my library project in its root > directory. What I wanted was to maintain my library in the 'mylib' > branch, then merge my library into the "libs/mylib" directory of my > application, which is in the 'myapp' branch. [...] > > This actually works like magic in git - except when you create a file > in the 'mylib' branch, in which case it gets merged to the wrong path > every single time. It seems to me like it should be very easy to put > it in the right place instead, making one more interesting use case > possible. > > I realize git-submodule is the way you're supposed to do something > like this, but git-submodule doesn't really do what I want (yet) for > reasons discussed in other threads.
`git pull -s subtree mylib` ?
This is how git-gui and gitk are merged into git.git, and it avoids this case by looking for a subdirectory rename, more specifically a rename of "/" to "mylib/".
It also can go the other way, that is rename "mylib/" to "/", but this path is never used as far as I know as git-gui and gitk don't ever merge in the git.git history.
-- Shawn.