你如何显示在.gitignore中不存在的未跟踪文件 [英] How do you git show untracked files that do not exist in .gitignore
问题描述
我使用 git status -u
显示未跟踪的文件。并且在终端上,我看到很多未跟踪的文件,我需要进行未跟踪,例如单元测试,个人文档等。我已将它们放在 .gitignore
中,但似乎 git status
仍然会显示它们。
I'm using git status -u
to show untracked files. And on the terminal, I see plenty untracked files that I need to be untracked such as unit tests, personal documentation, etc. I have put them in .gitignore
, but it seems that git status
still shows them.
如何显示<$ $中不存在的未跟踪文件c $ c> .gitignore 。
推荐答案
您可以明确列出正在跟踪和未跟踪的内容接下来看看Git是否看到并遵守你的 .gitignore
。如果您发布了 .gitignore
内容, git status
输出,并且 dir
ls 我们可以更好地协助您。
列出忽略档案
You can explicitly list what is being tracked and untracked as follows to see if Git is seeing and honoring your .gitignore
. If you post your .gitignore
contents, git status
output, and dir
or ls
we can better assist you.
$ git ls-files . --ignored --exclude-standard --others
列出未跟踪文件
List untracked files
$ git ls-files . --exclude-standard --others
这篇关于你如何显示在.gitignore中不存在的未跟踪文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!