解决git pull出现: Your local changes to the following files would be overwritten by merge: ...的问题

今天在服务器上git pull是出现以下错误:

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

        application/config/config.php

        application/controllers/home.php

Please, commit your changes or stash them before you can merge.

Aborting

但服务器上的代码并没有更新过,不可能有代码上的冲突。

最后搜索结果得知,是因为git配置文件config里面的:filemode = true 造成的。

filemode 默认值是true,表示强制检测文件mode,把它改为false,表示不检测文件filemode,git pull 成功。

临时修改:git config core.filemode false

全局修改:git config --global core.filemode false

是因为在win上开发后,文件权限改变了,在服务器上更新,git强制比较,就会造成这种结果。

 

posted @ 2018-04-03 18:15  cqingt  阅读(1337)  评论(0编辑  收藏  举报