{"thread":{"id":"26199","subject":"How to import a exist git repository into another git repository?","startedAt":"2011-01-05T06:50:35Z","lastAt":"2011-01-05T07:02:39Z","messageCount":2,"participants":["Edmond Halley","Andrew Garber"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"158948","messageId":"AANLkTi=ahqFz=NVMrhtf+u2fJR_PAW-vcXgNYcce=2R+@mail.gmail.com","threadId":"26199","inReplyTo":null,"subject":"How to import a exist git repository into another git repository?","fromName":"Edmond Halley","fromEmail":"halleyinvent@gmail.com","sentAt":"2011-01-05T06:50:35Z","receivedAt":"2011-01-05T06:50:35Z","isPatch":false,"sender":{"key":"halleyinvent@gmail.com","avatar":null},"body":"Hi,\n\nI have two exit repos A and B. I would like A becomes part of B. For example:\noriginal:\nA\n|-- a.cpp\n`-- Makefile\n\nB\n|-- b.cpp\n`-- Makefile\n\ncombined:\nB\n|-- b.cpp\n|-- Makefile\n`-- A\n    |-- a.cpp\n    `-- Makefile\n\nThe git log of repo A is kept in the combined repo.\n\nI try google but the following methods turn out they do not work like\nwhat I want. I can not view the log of original repo A after\ncombining.\n1) http://stackoverflow.com/questions/1683531/how-to-import-existing-git-repository-into-another\nFail at the following command.\ngit checkout -b ZZZ other/master\nerror: Untracked working tree file 'Makefile' would be overwritten by merge.\n\n2) http://thread.gmane.org/gmane.comp.version-control.git/5126/\ngit log only give the lastest commit message. I do not know how to get\nthe log if orignal repo A.\n\nThank you!\n\nBest regards,\nHalley\n"},{"id":"158950","messageId":"AANLkTin=AdUYEj8CJ=+YMROFh3BWhn4A+AeL+8fxkuoa@mail.gmail.com","threadId":"26199","inReplyTo":"AANLkTi=ahqFz=NVMrhtf+u2fJR_PAW-vcXgNYcce=2R+@mail.gmail.com","subject":"Re: How to import a exist git repository into another git repository?","fromName":"Andrew Garber","fromEmail":"andrew@andrewgarber.com","sentAt":"2011-01-05T07:02:39Z","receivedAt":"2011-01-05T07:02:39Z","isPatch":false,"sender":{"key":"andrew@andrewgarber.com","avatar":"https://avatars.githubusercontent.com/u/265048?v=4"},"body":"What you're looking for is subtree merge:\n\nhttp://progit.org/book/ch6-7.html\n\nhttp://www.kernel.org/pub/software/scm/git/docs/howto/using-merge-subtree.html\n\n- Andrew Garber\n\nOn Tue, Jan 4, 2011 at 10:50 PM, Edmond Halley <halleyinvent@gmail.com> wrote:\n> Hi,\n>\n> I have two exit repos A and B. I would like A becomes part of B. For example:\n> original:\n> A\n> |-- a.cpp\n> `-- Makefile\n>\n> B\n> |-- b.cpp\n> `-- Makefile\n>\n> combined:\n> B\n> |-- b.cpp\n> |-- Makefile\n> `-- A\n>    |-- a.cpp\n>    `-- Makefile\n>\n> The git log of repo A is kept in the combined repo.\n>\n> I try google but the following methods turn out they do not work like\n> what I want. I can not view the log of original repo A after\n> combining.\n> 1) http://stackoverflow.com/questions/1683531/how-to-import-existing-git-repository-into-another\n> Fail at the following command.\n> git checkout -b ZZZ other/master\n> error: Untracked working tree file 'Makefile' would be overwritten by merge.\n>\n> 2) http://thread.gmane.org/gmane.comp.version-control.git/5126/\n> git log only give the lastest commit message. I do not know how to get\n> the log if orignal repo A.\n>\n> Thank you!\n>\n> Best regards,\n> Halley\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>\n"}]}