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

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

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

        application/config/config.php服务器

        application/controllers/home.phpapp

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

Aborting开发

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

最后搜索结果得知,是由于git配置文件config里面的:filemode = true 形成的。io

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

临时修改:git config core.filemode falsefile

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

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

相关文章
相关标签/搜索