Reputation: 75589
That is, suppose I want a patch that will take me from branch1
to branch2
, but I only care about files foo1.c
and foo2.c
, whereas other files also changed between the two branches.
How can I make a patch including exactly these two files?
If I just do git diff branch1 branch2 > Change.patch
, I will get all the files.
If I just do git diff branch1:foo1.c branch2:foo1.c > Change.patch
, I only get the patch for one file.
Upvotes: 1
Views: 125
Reputation: 62479
Something along these lines should work:
git diff branch1 branch2 -- foo1.c foo2.c > change.patch
Upvotes: 1