{"thread":{"id":"19756","subject":"Git merge selective files","startedAt":"2009-06-09T09:53:41Z","lastAt":"2009-06-09T20:54:05Z","messageCount":5,"participants":["joe higton","Avery Pennarun","Alex Riesen","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"115894","messageId":"34b359190906090253v653ecc71q6684f4ebff2be59d@mail.gmail.com","threadId":"19756","inReplyTo":null,"subject":"Git merge selective files","fromName":"joe higton","fromEmail":"draxil@gmail.com","sentAt":"2009-06-09T09:53:41Z","receivedAt":"2009-06-09T09:53:41Z","isPatch":false,"sender":{"key":"draxil@gmail.com","avatar":null},"body":"Hi,\n     I want to merge changes from a branch but only to one file, I\ndon't want to pick up the changes from other files. I've scoured\ngoogle and the docs a bit but I can't find anything useful. Is this\npossible?\n\nTa,\n  Joe.\n\n-- \nGmail is watching you!!!!!!\n\nPlease don't publish this email address or use it for anything SPAM\nrisky. My more public email address is joe@draxil.uklinux.net\n"},{"id":"115932","messageId":"32541b130906091132sc5a647cn5fe0289ff9793cc3@mail.gmail.com","threadId":"19756","inReplyTo":"34b359190906090253v653ecc71q6684f4ebff2be59d@mail.gmail.com","subject":"Re: Git merge selective files","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2009-06-09T18:32:14Z","receivedAt":"2009-06-09T18:32:14Z","isPatch":false,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On Tue, Jun 9, 2009 at 5:53 AM, joe higton<draxil@gmail.com> wrote:\n>     I want to merge changes from a branch but only to one file, I\n> don't want to pick up the changes from other files. I've scoured\n> google and the docs a bit but I can't find anything useful. Is this\n> possible?\n\nYou might want to try just using\n\n    git diff old-version new-version | patch -p1\n\n(where old-version and new-version are the appropriate commit ids or\nbranch names or whatever)\n\nAnd then committing the results.\n\nHave fun,\n\nAvery\n"},{"id":"115943","messageId":"81b0412b0906091235g7a65d076l145c3eb3cbbdce3@mail.gmail.com","threadId":"19756","inReplyTo":"34b359190906090253v653ecc71q6684f4ebff2be59d@mail.gmail.com","subject":"Re: Git merge selective files","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2009-06-09T19:35:58Z","receivedAt":"2009-06-09T19:35:58Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"2009/6/9 joe higton <draxil@gmail.com>:\n> Hi,\n>     I want to merge changes from a branch but only to one file, I\n> don't want to pick up the changes from other files. I've scoured\n> google and the docs a bit but I can't find anything useful. Is this\n> possible?\n\nGenerally - no. But you can have a merge with only the content\nof your choice:\n\n  git merge -s ours --no-commit other\n\nthen copy the changes you need manually, and commit.\nSee the manpage of git merge about \"ours\" merge strategy.\n"},{"id":"115945","messageId":"32541b130906091239x1c92a1caxd260983a66e8025f@mail.gmail.com","threadId":"19756","inReplyTo":"4A2EB575.8050107@workspacewhiz.com","subject":"Re: Git merge selective files","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2009-06-09T19:39:31Z","receivedAt":"2009-06-09T19:39:31Z","isPatch":false,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On Tue, Jun 9, 2009 at 3:18 PM, Joshua Jensen<jjensen@workspacewhiz.com> wrote:\n> On Tue, Jun 9, 2009 at 5:53 AM, joe higton<draxil@gmail.com> wrote:\n>>     I want to merge changes from a branch but only to one file, I\n>> don't want to pick up the changes from other files. I've scoured\n>> google and the docs a bit but I can't find anything useful. Is this\n>> possible?\n>\n> I like this one:\n>\n> http://jasonrudolph.com/blog/2009/02/25/git-tip-how-to-merge-specific-files-from-another-branch/\n\nCareful... that *replaces* the files with the ones from the branch.\nIt doesn't *merge* them.  Although that may be exactly what you want.\n\nAnd the \"'merge --squash' and don't commit the changes you don't want\"\noption looks okay to me too.\n\nAvery\n"},{"id":"115956","messageId":"7v63f5ku1e.fsf@alter.siamese.dyndns.org","threadId":"19756","inReplyTo":"32541b130906091239x1c92a1caxd260983a66e8025f@mail.gmail.com","subject":"Re: Git merge selective files","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-06-09T20:54:05Z","receivedAt":"2009-06-09T20:54:05Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Avery Pennarun <apenwarr@gmail.com> writes:\n\n> And the \"'merge --squash' and don't commit the changes you don't want\"\n> option looks okay to me too.\n\nWhatever you do to prepare the tree contents to suit the desire of the\noriginal request, I think it is essential not to record the result of such\nan operation as a merge (because it is not, and it will screw up later\nmerges).\n\nUse of \"merge --squash\" in this thread is a very good suggestion.\n\nGood job.\n"}]}