Git: list all files in another branch that are not in the current branch?

I'd like to used "--diff-filter" flag to as like you want:

git diff --diff-filter=[D|M|A] branch1 branch2

As:

  • D: sort files existing in branch1 only.
  • M: sort files have been modified
  • A: sort files existing in branch2 only.

You can use all of them at the same time, also with "--stat" flag for a quick view of the changes.


There is the exact same question on SO.

You can use git diff-tree to achieve what you want

use -r to recursively descend through subtree and --diff-filter to restrict output to only certain types of diffs (for instance, deletions=D)

git diff-tree -r --diff-filter=D branchA branchB

Tags:

Git