我怎样才能列出所有删除的文件在git仓库? [英] How can I list all the deleted files in a git repository?

查看:145
本文介绍了我怎样才能列出所有删除的文件在git仓库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道git存储何时删除文件的信息,并且我可以检查单个提交以查看哪些文件已被删除,但有没有一个命令可以在存储库的寿命期间生成每个已删除文件的列表?

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?

推荐答案

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

请参阅在Git存储库中查找并恢复已删除的文件

如果您不想获得关于它们是哪个提交的所有信息你可以在那里添加一个 grep delete

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

这篇关于我怎样才能列出所有删除的文件在git仓库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆