Git命令显示.gitignore忽略哪些特定文件

耗尽温柔 提交于 2020-08-17 17:22:53

问题:

I am getting my feet wet on git and have the following issue: 我在git上弄湿了,并遇到以下问题:

My project source tree: 我的项目源代码树:

/
|
+--src/
+----refs/
+----...
|
+--vendor/
+----...

I have code (currently MEF) in my vendor branch that I will compile there and then move the references into /src/refs which is where the project picks them up from. 我的供应商分支中有代码(当前为MEF),我将在此处进行编译,然后将引用移至项目从中提取的/src/refs中。

My issue is that I have my .gitignore set to ignore *.dll and *.pdb . 我的问题是我将.gitignore设置为忽略*.dll*.pdb I can do a git add -f bar.dll to force the addition of the ignored file which is ok, the problem is I can not figure out to list what files exist that are ignored. 我可以做一个git add -f bar.dll来强制添加被忽略的文件,这是可以的,问题是我不知道列出哪些文件被忽略了。

I want to list the ignored files to make sure that I don't forget to add them. 我想列出被忽略的文件,以确保我不会忘记添加它们。

I have read the man page on git ls-files and can not make it work. 我已经阅读了git ls-files上的手册页,无法使其工作。 It seems to me that git ls-files --exclude-standard -i should do what I want. 在我看来, git ls-files --exclude-standard -i应该可以执行我想要的操作。 What am I missing? 我想念什么?


解决方案:

参考一: https://stackoom.com/question/1xQS/Git命令显示-gitignore忽略哪些特定文件
参考二: https://oldbug.net/q/1xQS/Git-command-to-show-which-specific-files-are-ignored-by-gitignore
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!