Find files of commit A that have changed compared to commit B with git?
Question
I am looking for something like "git diff --name-only B A", but limited to files contained in commit A. Or, in other words, I need a list of all files changed with commit A (excluding history) that are not the same as in commit B (including history).
Is there an easy way to do this in git?
Regards, Jochen
Solution
You can use the --diff-filter
option to do this. To find only the files that are modified (rather than deleted or added, say) between A
and B
, you could do:
git diff --name-only --diff-filter=M B A
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow