How to know which part of .gitignore that is actually responsible for ignoring some file?

血红的双手。 提交于 2019-12-08 02:45:39

问题


Say I have .gitignore:

x64/
x86/
bin/
obj/
FileA
FileB
FileC
etc..

Now when I build, all build files that I want to ignore, are actually being ignored. However, the build fails for a missing file (Call it FileX).

When I add FileX to the project, it builds fine with no errors. However, GIT does not see that I added that file, and when I do git status --ignored, I see the file under untracked files.

I tried the solution in undo git assume unchanged with no success.

Why this file is being ignored and I did not add it to .gitignore?


回答1:


To make sure why this file is being ignored, type:

git check-ignore -v -- path/to/FileX

You will see the actual .gitignore file responsible for its current ignored state.
If the output of that command is empty, that means the file is simply untracked, ready to be added.



来源:https://stackoverflow.com/questions/51349901/how-to-know-which-part-of-gitignore-that-is-actually-responsible-for-ignoring-s

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