Git Pull试图覆盖被忽略的文件

时间:2014-01-21 23:02:19

标签: git

我正在运行git pull,但是我收到以下错误:

 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试图覆盖我告诉忽略的文件?另外,如何在不覆盖配置文件的情况下提取所需的所有文件?

1 个答案:

答案 0 :(得分:3)

仅仅因为文件被忽略并不意味着它没有被您或其他人首先签入。

看看

git log config.js

按照它说的做,将文件移开,git pull然后将其移回。您可能需要运行

git rm --cached config.js
相关问题