【git】error: Your local changes to the following files c

作者: shaneZhang 分类: 互联网技术 发布时间: 2015-03-27 09:47

今天在服务器上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 stash
git pull
git stash pop

然后可以使用git diff -w +文件名 来确认代码自动合并的情况.
如果希望用代码库中的文件完全覆盖本地工作版本. 方法如下:

git reset --hard
git pull

本页面支持繁体中文友好显示:【git】error: Your local changes to the following files c

如果觉得我的文章对您有用,请随意打赏。如果有其他问题请联系博主QQ(909491009)或者下方留言!

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注