Netbeans和Git,.obj文件被忽略了

ele*_*ect 6 git github gitignore netbeans-8

我正在开发一个涉及.obj文件的小git项目.

当我查看"项目标签"时,我发现它们被忽略了

在此输入图像描述

但我不明白为什么,如果我看看我的.gitignore:

/DepthPeeling/nbproject/private/
/DepthPeeling/dist/
/DepthPeeling/build/
Run Code Online (Sandbox Code Playgroud)

看起来很好

如果我打开一个Git Bash并输入

$ git add dragon.obj
The following paths are ignored by one of your .gitignore files:
DepthPelling/sry/depthPeeling/data/dragon.ogj
Use -f if you really want to add them.
fatal: no file added
Run Code Online (Sandbox Code Playgroud)

武汉理工大学?

可能有不止一个.gitignore文件?如果我找到它们,我只找到项目本身的根目录中的一个(我之前显示的那个),仅此而已......

编辑:所以看起来我有一个全局忽略D:\ Documents\gitignore_global.txt

#ignore thumbnails created by windows
Thumbs.db
#Ignore files build by Visual Studio
*.obj
*.exe
*.pdb
*.user
*.aps
*.pch
*.vspscc
*_i.c
*_p.c
*.ncb
*.suo
*.tlb
*.tlh
*.bak
*.cache
*.ilk
*.log
*.dll
*.lib
*.sbr
Run Code Online (Sandbox Code Playgroud)

Von*_*onC 14

您可以使用以下命令轻松找到哪个.gitignore(以及哪个规则)负责忽略您的.obj文件git check-ignore:

git check-ignore -v -- dragon.obj
Run Code Online (Sandbox Code Playgroud)

OP报告:

"D:\\Documents\\gitignore_global.txt":5:*.obj –
Run Code Online (Sandbox Code Playgroud)

这与此评论类似:

它是SourceTree(一个工具可视化git repo)的安装,它在文档文件夹a下非逻辑地创建,gitignore_global.txt其中包含大量的排除项.

A git config -l应该显示类似于:

[core] 
   excludesfile = C:\\Users\\username\\Documents\\gitignore_global.txt
Run Code Online (Sandbox Code Playgroud)