On Fri, Apr 03, 2015 at 08:27:47PM +0200, Martin Møller Skarbiniks Pedersen wrote: > On 3 April 2015 at 15:25, Hseu-Ming Chen <hseum...@gmail.com> wrote: > > > 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. > > > > > In that case, you probably want to create a fake common parent-commit using > the so-called graft points. > > See more at: > https://git.wiki.kernel.org/index.php/GraftPoint
Graft points is one way, another is, especially if the repos aren't too big, to just export one of the repos and import it into the other. Or even easier, just rebase one on top of the other after adding it as a remote: ~~~ in git folder A % git remote add be file:///home/magnus/tmp/gitB/ git fetch be warning: no common commits remote: Counting objects: 8, done. remote: Compressing objects: 100% (4/4), done. remote: Total 8 (delta 1), reused 0 (delta 0) Unpacking objects: 100% (8/8), done. >From file:///home/magnus/tmp/gitB * [new branch] master -> be/master % git lola * cf4c7a2 (be/master) Add some text to bar2. * e390b7b Creating folder and files for bar. * 634f4f5 (HEAD, master) Some text in foo0. * 8936253 Creating foo files. % git rebase be/master First, rewinding head to replay your work on top of it... Applying: Creating foo files. Applying: Some text in foo0. % git lola * 9c84863 (HEAD, master) Some text in foo0. * 6319c93 Creating foo files. * cf4c7a2 (be/master) Add some text to bar2. * e390b7b Creating folder and files for bar.% git lola ~~~ /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: mag...@therning.org jabber: mag...@therning.org twitter: magthe http://therning.org/magnus I invented the term Object-Oriented, and I can tell you I did not have C++ in mind. -- Alan Kay -- 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.
Description: PGP signature