How to know which part of .gitignore that is actua

2019-05-20 11:17发布

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?

标签: git gitignore
1条回答
聊天终结者
2楼-- · 2019-05-20 11:38

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.

查看更多
登录 后发表回答