{"thread":{"id":"19775","subject":"Copying files and keeping the history","startedAt":"2009-06-11T13:20:05Z","lastAt":"2009-06-12T03:44:15Z","messageCount":3,"participants":["JörgenHägg","Sverre Rabbelier","Avery Pennarun"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"116082","messageId":"18567.1244726405@zev.se.axis.com","threadId":"19775","inReplyTo":null,"subject":"Copying files and keeping the history","fromName":"JörgenHägg","fromEmail":"jorgen.hagg@axis.com","sentAt":"2009-06-11T13:20:05Z","receivedAt":"2009-06-11T13:20:05Z","isPatch":false,"sender":{"key":"jorgen.hagg@axis.com","avatar":null},"body":"\nI have two completely different git repositories, A and B.\n\nI want to move a file from repo A to B without losing the files history.\nThat is, I want the commit message and all other info from\neach commit where the file was included to generate new\ncommits in repo B.\n(Yes, I know git manages content, not files. :-)\n\nIn other words, export a bunch of commits, filtering out the\npatches for the file and import these in another repo.\n\nSort of importing from cvs to git, only the source and destination\nare both git repositories.\n\nI tried tailor from git to git, but that was probably not what tailor\nwanted to do. :-)\n\nIs this somehow possible?\n\n"},{"id":"116087","messageId":"fabb9a1e0906111129x53a6d90p15a97d958a2d2f63@mail.gmail.com","threadId":"19775","inReplyTo":"18567.1244726405@zev.se.axis.com","subject":"Re: Copying files and keeping the history","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2009-06-11T18:29:47Z","receivedAt":"2009-06-11T18:29:47Z","isPatch":false,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Thu, Jun 11, 2009 at 15:20, JörgenHägg<jorgen.hagg@axis.com> wrote:\n> Is this somehow possible?\n\nTry git filter-branch to get just the commits you want and nudge them\nto contain what you want (do this in a seperate branch/copy of\nrepository A). When you're done, pull the branch into B and merge it.\nInstant win?\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"116118","messageId":"32541b130906112044m7cf2c0e9s2ba4815a31e534a@mail.gmail.com","threadId":"19775","inReplyTo":"fabb9a1e0906111129x53a6d90p15a97d958a2d2f63@mail.gmail.com","subject":"Re: Copying files and keeping the history","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2009-06-12T03:44:15Z","receivedAt":"2009-06-12T03:44:15Z","isPatch":false,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On Thu, Jun 11, 2009 at 2:29 PM, Sverre Rabbelier<srabbelier@gmail.com> wrote:\n> On Thu, Jun 11, 2009 at 15:20, JörgenHägg<jorgen.hagg@axis.com> wrote:\n>> Is this somehow possible?\n>\n> Try git filter-branch to get just the commits you want and nudge them\n> to contain what you want (do this in a seperate branch/copy of\n> repository A). When you're done, pull the branch into B and merge it.\n> Instant win?\n\nYou could also consider 'git subtree'\n(http://github.com/apenwarr/git-subtree) to merge the other tree\n(including its history) in as a subdirectory.\n\nAvery\n"}]}