In Git, how can I list all the files that exist in branch A that do not exist in branch B

Is it possible to use the Git command, which will display the names of all files existing in one branch that do not exist in another branch?

Background: someone deleted some story and then pushed the start / master. Some team members said they had no files. I think I restored the missing patch files that I created from the diff commands. I forked the wizard after the story was deleted and applied my patch to a new branch. Now I would just like to see what files exist in the new branch that are not in the HEAD of the master branch. For now, I just need file names, regardless of the contents, and only for files that exist in the new branch and do not exist in the HEAD wizard.

+5
source share
1 answer

You can use git diff-tree to achieve the desired

use -r to recursively go down the subtree and --diff-filter to restrict the output to only certain types of differences (e.g. delete = D)

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

+14
source

Source: https://habr.com/ru/post/1212465/


All Articles