Reputation: 871
git diff branch..branch1 will generate all the difference between two branches.
is there a way to diff a given list of files?
'git diff branch..branch1 filename' can do it for just one file, what if I want to supply a list of files?
Upvotes: 0
Views: 933
Reputation: 506
You can use glob patterns. For instance, if you have the following folder structure
-project
-client
-...more folders
-server
-...more folders
from the project folder you could run the following commmand:
git diff client/**
which would give you a diff of everything in the client folder and subfolders, but ignore the server folders.
Upvotes: 0
Reputation: 2179
You can do:
git diff branch..branch1 -- file1 file2
So if you have a filelist, you can use a shell expansion (in bash, for example) to enumerate the contents of your filelist.
> cat filelist
file1
file2
> echo $(cat filelist)
file1 file2
> git diff branch..branch1 -- $(cat filelist)
where the final command should be what you're looking for.
Upvotes: 1