{"thread":{"id":"27736","subject":"bringing changes from one repo to other","startedAt":"2011-06-30T17:36:10Z","lastAt":"2011-06-30T20:19:49Z","messageCount":2,"participants":["Shantanu Pavgi","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"170716","messageId":"F750768F-DC8E-435E-813A-C89AE9B9D89A@uab.edu","threadId":"27736","inReplyTo":null,"subject":"bringing changes from one repo to other","fromName":"Shantanu Pavgi","fromEmail":"pavgi@uab.edu","sentAt":"2011-06-30T17:36:10Z","receivedAt":"2011-06-30T17:36:10Z","isPatch":false,"sender":{"key":"pavgi@uab.edu","avatar":null},"body":"\nHi,\n\nI need to bring in changes from one git repository (say repo-A) to other(say repo-B) preferably preserving the commit history. The repo-A contains few initial bad-commit points - includes files that should have been ignored (e.g temporary files generated at runtime) and large number of files got committed in one go. Also, the repo-A and repo-B don't have any common commit point with common set of files. Is there any way to get commits from repo-A to repo-B? I tried git cherry-pick, but I am not able to preserve history after resolving conflicts.  Any comments or suggestions will be really helpful. \n\nThanks,\nShantanu.\n"},{"id":"170729","messageId":"20110630201949.GA25850@sigill.intra.peff.net","threadId":"27736","inReplyTo":"F750768F-DC8E-435E-813A-C89AE9B9D89A@uab.edu","subject":"Re: bringing changes from one repo to other","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-06-30T20:19:49Z","receivedAt":"2011-06-30T20:19:49Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Jun 30, 2011 at 12:36:10PM -0500, Shantanu Pavgi wrote:\n\n> I need to bring in changes from one git repository (say repo-A) to\n> other(say repo-B) preferably preserving the commit history. The repo-A\n> contains few initial bad-commit points - includes files that should\n> have been ignored (e.g temporary files generated at runtime) and large\n> number of files got committed in one go. Also, the repo-A and repo-B\n> don't have any common commit point with common set of files. Is there\n> any way to get commits from repo-A to repo-B? I tried git cherry-pick,\n> but I am not able to preserve history after resolving conflicts.  Any\n> comments or suggestions will be really helpful.\n\nIt sounds like you should use \"git filter-branch\" to edit the history in\nrepo-A into the shape you want (or even \"git rebase -p -i\" if the\nhistory is simple and small), and then merge it into repo-B.\n\nNote that this would mean throwing away the old repo-A history (which it\nsounds like you want). If you want to include the full history, warts\nand all, then simply merge repo-A into repo-B. Git doesn't have a\nproblem with merging histories with no common commits (though of course\nyou may get more conflicts, since there is no useful ancestor for a\n3-way merge).\n\n-Peff\n"}]}