SoaringEagle <> writes:
> 1.  #  in the top-level directory of the cloned foo.git, add the bar repo 
> as remote_bar:
>     git remote add bar_remote <barRepoGitURL>
>     git fetch bar_remote
> 2.  #  merge the bar repo into foo
>     git merge -s ours --no-commit bar_remote/master

I'm no expert, but my guess is that you're telling Gig "merge everything
between the two commits, and where they differ, choose 'ours'".  But
since the top-level directories have different names, the two commits
differ regarding *everything*, so you only get the 'ours' stuff.

I think you could accomplish this by creating two clones, one with foo
checked out and one with bar checked out.  Then, in foo.git, do

cp -a bar.git-working-directory/* .
git add -A

Now you have all eight directories in your working directory.

Construct the file tree for a new commit containing all these files:

tree=$( git write-tree )

Create a new commit containing these files and with both the foo and bar
commits as parents:

commit=$( git commit-tree $tree foo-HEAD bar-HEAD )

Check out the new commit:

git checkout $commit


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

Reply via email to