From: Emily Ren Date: Tue, 03 Mar 2009 03:56:03 GMT Subject: Re: How can I merge some files rather than all files modified on one branch to my branch? Message-ID: <856bfe0e0903021956l549e41d2l97d7e0997067c133@mail.gmail.com> In-Reply-To: <200903022110.23207.bss@iguanasuicide.net> Junio and Boyd, Thank you very much for your kindly guide ! I'll try these method. Boyd, How to rewrite the history of the branch ? Thanks, Emily On Tue, Mar 3, 2009 at 11:10 AM, Boyd Stephen Smith Jr. wrote: > On Monday 02 March 2009 03:19:05 Emily Ren wrote: >> I want to merge some files rather than all files modified on one >> branch to my branch, how can I do? > > In addition to what Junio suggested, I'll offer another method, assuming the > branch you are merging from is not yet published: > (1) Rewrite the history of the to-be-merged branch so that all the changes to > the files you want occur "before" and in separate commits from the file you > want to ignore.  So the current tree: > > A-->B-->C (yours) >  \ >  ->D-->E (theirs) > > becomes: > > A-->B-->C (yours) >  \ >  ->D1-->E1-->D2-->E2 (theirs) > > with D1 and D2 being the separate parts of commit D and similarly for E1 and > E2. > > (2) Merge in the rewritten history, but only the part that you want, giving: > > A-->B-->C--->F (yours) >  \         / >  ->D1-->E1-->D2-->E2 (theirs) > > This preserves the full intent of what you are trying to do, a partial merge. > If you merge "theirs" in fully at some point in the future, you shouldn't see > any conflicts arising from not recording the merge or missing changes arising > from recording a full merge that did not happen. > -- > Boyd Stephen Smith Jr.                   ,= ,-_-. =. > bss@iguanasuicide.net                   ((_/)o o(\_)) > ICQ: 514984 YM/AIM: DaTwinkDaddy         `-'(. .)`-' > http://iguanasuicide.net/                    \_/ > >