本文介绍了我怎样才能让git显示正在跟踪的文件列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用命令行git,我该如何让git显示正在存储库中被跟踪的文件的列表?
Using command line git, how can I make git show a list of the files that are being tracked in the repository?
推荐答案
如果您想列出分支 master
下的所有当前正在跟踪的文件,您可以使用以下命令:
If you want to list all the files currently being tracked under the branch master
, you could use this command:
git ls-tree -r master --name-only
如果您想要一个曾经存在的文件列表(即包括已删除的文件):
If you want a list of files that ever existed (i.e. including deleted files):
git log --pretty=format: --name-only --diff-filter=A | sort - | sed '/^$/d'
这篇关于我怎样才能让git显示正在跟踪的文件列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!