Get a list of files present in the old branch, not present in the new?

In GIT, when I switch from a branch branch-ato branch-b, how do I get a list of files present in branch-b, but not in branch-a?

I need this for a specific directory, but as soon as I have a list of all the files, I can filter myself. But if there is a way to get a list only for a specific directory, better.

+4
source share
1 answer

This should work:

git diff --name-only branch-a..branch-b  --diff-filter=A

You can list files related only to the directory with:

 git diff --name-only branch-a..branch-b  --diff-filter=A --relative=directory
+1
source

All Articles