Netbeans和Git,.obj文件被忽略 [英] Netbeans and Git, .obj files ignored
问题描述
当我看到项目选项卡时,我发现它们被忽略了
但我无法理解为什么,如果我看看我的.gitignore:
/ DepthPeeling / nbproject / private /
/ DepthPeeling / dist /
/ DepthPeeling / build /
如果我打开Git Bash并键入
$ git add dragon.obj
您的.gitignore文件会忽略以下路径:
DepthPelling / sry / depthPeeling / data / dragon.ogj
如果您真的想添加它们,请使用-f。
致命:没有添加文件
可能它有多个.gitignore文件?如果我寻找他们,我只找到项目本身的根目录中的一个(我之前展示的那个),没有更多的东西。
编辑:所以它看起来像我有一个全局忽略D:\ Documents \gitignore_global.txt
#ignore缩略图由windows创建
Thumbs.db
#通过Visual Studio构建的#Ignore文件
* .obj
* .exe
* .pdb
* .user
* .aps
* .pch
* .vspscc
* _i.c
* _p.c
* .ncb
* .suo
*。 tlb
* .tlh
* .bak
* .cache
* .ilk
* .log
* .dll
* .lib
* .sbr
.gitignore
(以及哪个规则)负责使用 git check-ignore
:
git check-ignore -v - dragon.obj
OP报告:
D:\\Documents\\gitignore_global.txt:5:* .obj -
这与对此评论类似:
这是安装 SourceTree (一个可视化git仓库的工具),它在文档文件夹下创建一个
gitignore_global.txt
,其中包含大量排除项。 / p>
一个 git config -l </ code>应显示类似于:
[core]
excludesfile = C:\\ Users \\\\ username\\Documents\\ gitignore_global.txt
I am working on a small git project involving .obj files.
When I look at the "project tab" I see they are ignored
But I cant understand why, if I look at my .gitignore:
/DepthPeeling/nbproject/private/
/DepthPeeling/dist/
/DepthPeeling/build/
It looks fine
If I open a Git Bash and type
$ 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
Wut?
Might it be there is more than one .gitignore file? If I look for them, I find only the one in the root directory of the project itself (the one I shown before) and nothing more..
Edit: so it looks like I have a global ignore 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
You can easily find which .gitignore
(and which rule) is responsible for ignoring your .obj
file using git check-ignore
:
git check-ignore -v -- dragon.obj
The OP reports:
"D:\\Documents\\gitignore_global.txt":5:*.obj –
That is similar to this comment:
it was the installation of SourceTree (a tool visualize git repo) which un-logically created under documents folder a
gitignore_global.txt
which included plenty of exclusions.
A git config -l
should show something similar to:
[core]
excludesfile = C:\\Users\\username\\Documents\\gitignore_global.txt
这篇关于Netbeans和Git,.obj文件被忽略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!