4

like the inverse of git diff --name-only

2 Answers 2

2

You could do this using the comm command and some shell commands:

git ls-files >files.txt git diff --name-only >diff.txt comm -2 -3 files.txt diff.txt 
Sign up to request clarification or add additional context in comments.

Comments

1

You can do this by looking at unique values from ls-tree and diff with the --name-only options (done in one line so it's easier to search and use from history later):

cat <(git ls-tree --name-only -r HEAD) <(git diff --name-only HEAD^ HEAD) | sort | uniq -u 

In the example, the 2 revisions are HEAD and HEAD^. This produces no side effect output files.

Comments