Sunday 15 May 2011

git - How do I create a patch from one branch to another using only a subset of the files that were changed? -


It looks like I need a patch that will take me from branch1 to branch2 , but I only care about the file foo1.c and foo2.c , while the other files have also been changed between the two branches. .

How do I create a patch with these two files?

If I just go to git diff branch1 branch2> Change.patch , I'll find all the files.

If I just go to git diff branch1: foo1.c branch2: foo1.c & gt; Change.patch , I only receive patches for one file.

You should do some work with these lines:

  git diff Branch1 branch2 - foo1.c foo2.c & gt; Change.patch    

No comments:

Post a Comment