Jonah
Jonah

Reputation: 16222

A git diff which shows the differences between shared files, and ignores unshared files

I want to see the differences between all files that exist in both commitA and commitB. If a file exists in one commit but not in the other, it should be ignored. Is there an easy command for this?

Upvotes: 0

Views: 27

Answers (1)

CB Bailey
CB Bailey

Reputation: 792337

You can use --diff-filter to restrict the diff to modified files only:

git diff --diff-filter=M commitA commitB

Upvotes: 1

Related Questions