2012-05-25 75 views
2

我不断收到此错误:Git的枢纽GitIgnore错误

error: Your local changes to the following files would be overwritten by merge: 
    .gitignore 

我如何使它忽略我的主目录中的.gitignore文件?

我的.gitignore看起来像这样和被忽略:

# Can also ignore all directories and files in a directory. 
app/config/** 
app/config/**/* 
plugins/** 
vendors/shells/**/* 
+0

为什么这是-1? – cdub

+0

也许是因为你提出了错误的问题(解决方案是不要忽略.gitignore文件)。这有点苛刻,但不要太担心一个downvote。顺便说一句,如果你使用gui进行git操作,或者有理由认为.gitignore文件已经自动生成,那么它就是精确的。 –

+0

你是什么意思“我的HOME目录”? .gitignore文件必须位于git存储库中。你把你的linux家在git下? –

回答

3

不要忽略它。

但是提交它。没有理由不保存这个文件。

如果您提交并合并,合并将(可能正确)添加您的规则和收到的。

+0

好吧然后我没有git add。然后git commit -m“测试”,但现在gitignore根本没有工作 – cdub

+0

编辑文件。怎么样 ? –

+0

在上面添加了它,但忽略了它 – cdub