Explore Courses Blog Tutorials Interview Questions
0 votes
in DevOps and Agile by (29.3k points)

I know git stores information of when files get deleted and I am able to check individual commits to see which files have been removed but is there a command that would generate a list of every deleted file across a repository's lifespan?

1 Answer

0 votes
by (50.2k points)

For listing all deleted files you could use:

git log --diff-filter=D --summary

And for info, you can see this answer:

If  you don’t need more details on which commit they were removed you could simply use:

git log --diff-filter=D --summary | grep delete

Warning: This lists all files which you've deleted. If you've deleted a file, then created a new file with the same name, it will show up on this list, even though there's a file with that name.

Browse Categories