Is there a way to tell git-status to ignore the effects of .gitignore files? [duplicate]

二次信任 提交于 2019-11-28 06:44:45

Try using git ls-files --other - it should list all files that git doesn't know about; i.e. those files that aren't in the repository and aren't ignored by .gitignore.

You can also use git ls-files --ignored --exclude-standard to see what files git is explicitly ignoring.

xiaobai

This option --ignored does the trick:

git status --ignored



(Update 1) I found the --ignored option alone doesn't work in certain git installations, perhaps it's a git bug. In those cases, an additional -s works for me:

git status -s --ignored

(Update 2) One user reported --ignored option is not supported in git version 1.7.0.4. My git version is 1.7.6. Another version 1.7.5.1 is the one that requires -s. You may try

git status -h

to see if --ignored is supported.

nalply

git clean -dXn

See: Git command to show which specific files are ignored by .gitignore

In fact this question seems to be a duplicate!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!