我想了解git ls-files命令中的排除模式。
所以我想使用ls-files
命令输出工作目录中所有被忽略的文件。我知道git status --ignored
会完成这项工作,但我的意思是在需要时使用排除模式。
我试过这个:git ls-files -i -x ./*.txt
为了输出所有被忽略的(文本文件除外)文件。虽然我有几个被忽略的文件但没有成功。
你能帮帮我吗?
答案 0 :(得分:1)
尝试git ls-files -o -i -x '*.txt'
答案 1 :(得分:0)
简单的StackOverflow搜索可以回答您的问题。
尝试以下任何一项:
git ls-files --others -i --exclude-from=.git/info/exclude
git ls-files --others -i --exclude-standard
参考:Git command to show which specific files are ignored by .gitignore