How can I list all the deleted files in a Git repository?
This does what you want, I think:
git log --all --pretty=format: --name-only --diff-filter=D | sort -u
... which I've just taken more-or-less directly from this other answer.
This prints only file paths without other info:
BETA.md
CONTRIBUTING.md
files/en-us/api/file_api/index.html
files/en-us/games/index/index.md
files/en-us/games/visual-js_game_engine/index.html
files/en-us/games/visual_js_ge/index.html
files/en-us/games/visual_typescript_game_engine/index.html
...
git log --diff-filter=D --summary
See Find and restore a deleted file in a Git repository
If you don't want all the information about which commit they were removed in, you can just add a grep delete
in there.
git log --diff-filter=D --summary | grep delete
Citing this Stack Overflow answer.
It is a pretty neat way to get type-of-change (A:Added, M:Modified, D:Deleted) for each file that got changed.
git diff --name-status HEAD~1000
If you're only interested in seeing the currently deleted files, you can use this:
git ls-files --deleted
if you then want to remove them (in case you deleted them not using "git rm") pipe that result to xargs git rm
git ls-files --deleted | xargs git rm