2014-01-21 32 views
0

我運行的git拉,但我得到以下錯誤:的Git上拉試圖覆蓋忽略的文件

error: Your local changes to the following files would be overwritten by merge: 
    config.js 
Please, commit your changes or stash them before you can merge. 
Aborting 

我gitignore文件看起來像這樣:

config.js 
Gruntfile.js 

爲什麼git的努力覆蓋我告訴忽略的文件?另外,如何在不覆蓋配置文件的情況下將所需的所有文件拖出來?

回答

3

僅僅因爲一個文件被忽略並不意味着它沒有被你或其他人首先檢入。

看一看

git log config.js 

做什麼它說,該文件移動的方式進行,git的拉然後移回。您可能需要運行

git rm --cached config.js