On Sat, 23 May 2015 23:02:46 +0530
Kalpa Welivitigoda <callka...@gmail.com> wrote:
> >> Use the `git subtree` command [*].
> > [...]
> > To elaborate, a pseudocode (assuming a POSIX shell) is something
> > like this:
> > $ cd repoB
> > $ git tag Bdir12 $(git subtree split dir1-2)
> > $ cd ../repoA
> > $ git fetch ../repoB Bdir12
> > $ git merge -s ours --no-commit Bdir12
> > $ git read-tree --prefix dir1/dir1-2 -u Bdir12
> > $ git commit --edit
> Thanks for all the support rendered. I tried the above method and it
> places the directory from repoB to the correct place on repoA. But if
> I log the commits for dir1-2 in repoA (git log dir1/dir1-2), it shows
> only the merging of the tag, not the individual commits for that
> particular directory. But if I do a git log from root of repoA, it
> shows all the commits. Is it possible to have the commits for dir1-2 ?
Given the merge commit, does
$ git log <that_merge_commit>^2
show you the proper history line?
That "^2" thing selects the second parent of a commit, and in the
case of a simple merge (two parents) this is the side which has been
merged into -- that is, the tree extracted by `git subtree split`).
On the same note, does
$ git log <that_tag_produced_by_git_subtree>
give you the history you're expecting to see?
I mean, we have to tell if you have a problem extracting the history
or the problem properly listing it (or some other problem).
I'd also recommend running
$ gitk --all
$ git log --all --graph --decorate --oneline
to see a neatly layed of overview of the commit graph in your repo.
In it, it should be easy to see if your merge commit actually has
two parents with the second one having a history extracted from the
source repo attached to it.
You received this message because you are subscribed to the Google Groups "Git
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email
For more options, visit https://groups.google.com/d/optout.