【发布时间】:2015-03-20 07:29:20
【问题描述】:
我正在处理一个涉及 .obj 文件的小型 git 项目。
当我查看“项目选项卡”时,我发现它们被忽略了
但我不明白为什么,如果我查看我的 .gitignore:
/DepthPeeling/nbproject/private/
/DepthPeeling/dist/
/DepthPeeling/build/
看起来不错
如果我打开一个 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
什么?
可能有多个 .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
【问题讨论】:
-
是的,每个目录中都可以有一个
.gitignore,和 ignored files can be specified in other ways。试试find <repo> -name .gitignore和cat <repo>/info/exclude。 -
你能在你的项目中搜索其他
.gitignore文件吗?从您的屏幕截图来看,您似乎正在运行 Windows。 -
@TimBiegeleisen 我刚刚使用了窗口浏览器
标签: git github gitignore netbeans-8