Sorry i forgot to mention that: no, the two repos don't have any common
history.   In this case, how do i merge the content of bar.git into foo.git?

Thanks.



On Fri, Apr 3, 2015 at 5:39 AM, Magnus Therning <mag...@therning.org> wrote:

> On 3 Apr 2015 7:51 am, "SoaringEagle" <hseum...@gmail.com> wrote:
> >
> > Hi,
> > i have two Git repos, foo.git and bar.git whose working trees look like:
> >
> > <foo.git>
> >    foo1/...
> >    ...
> >    foo6/...
> >
> > <bar.git>
> >    bar1/...
> >    bar2/...
> >
> > As shown above, there are 6 top-level sub-directories, namely foo1,
> foo2, ..., & foo6 in foo.git and 2 top-level sub-directories, bar1 and bar2
> in bar.git.
> >
> > i tried to merge the 2 repos together by merging the content of bar.git
> into foo.git so the new foo.git will contain all the original top-level
> sub-dirs from both foo.git and bar.git:
> >    foo1  foo2  foo3  foo4  foo5  foo6  bar1  bar2
> >
> > Here is what i did:
> >
> > 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
> >
> > 3.  #  read the tree info into the index
> >     git read-tree -m -u bar_remote/master
> >
> > At this time, i'm surprised to find out the top-level directory contains
> only the 2 sub-dirs of bar.git:
> >    bar1  bar2
> > and all the top-level foo[1-6] sub-dirs are gone so i can't proceed with
> commit and push.
> >
> > Where did i screw up?
>
> It's unclear from your description above whether the two repos have any
> common history. If they don't, then that might explain the behaviour you
> see.
>
> /M
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Git for human beings" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/git-users/4yTs3aCCU8M/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> git-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to