error: Your local changes to the following files would be overwritten by merge:
2017-10-30 10:13
495 查看
在发布这个配置文件的时候,会发生代码冲突:
error: Your local changes to the following files would be overwritten by merge:
protected/config/main.php
Please, commit your changes or stash them before you can merge.
如果希望保留生产服务器上所做的改动,仅仅并入新配置项, 处理方法如下:
然后可以使用git diff -w +文件名 来确认代码自动合并的情况.
反过来,如果希望用代码库中的文件完全覆盖本地工作版本. 方法如下:
其中git reset是针对版本,如果想针对文件回退本地修改,使用
[plain] view
plain copy
git checkout HEAD file/to/restore
error: Your local changes to the following files would be overwritten by merge:
protected/config/main.php
Please, commit your changes or stash them before you can merge.
如果希望保留生产服务器上所做的改动,仅仅并入新配置项, 处理方法如下:
git stash git pull git stash pop
然后可以使用git diff -w +文件名 来确认代码自动合并的情况.
反过来,如果希望用代码库中的文件完全覆盖本地工作版本. 方法如下:
git reset --hard git pull
其中git reset是针对版本,如果想针对文件回退本地修改,使用
[plain] view
plain copy
git checkout HEAD file/to/restore
相关文章推荐
- git提示 error: Your local changes to the following files would be overwritten by merge:
- git提示 error: Your local changes to the following files would be overwritten by merge:
- 解决error: Your local changes to the following files would be overwritten by merge
- git使用error: Your local changes to the following files would be overwritten by merge:
- git提示 error: Your local changes to the following files would be overwritten by merge:
- git提示 error: 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的解决办法
- Error pulling origin: error: Your local changes to the following files would be overwritten by merge
- Git版本控制工具使用:Error pulling origin: error: Your local changes to the following files would be overwritten by merge
- 解决error: Your local changes to the following files would be overwritten by merge
- git提示 error: Your local changes to the following files would be overwritten by merge:
- error: Your local changes to the following files would be overwritten by merge
- git提示 error: 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:
- git提示 error: 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:
- git pull 时出现 error: Your local changes to the following files would be overwritten by merge的解决办法
- git提示 error: Your local changes to the following files would be overwritten by merge:
- git提示 error: Your local changes to the following files would be overwritten by merge:
- git提示 error: Your local changes to the following files would be overwritten by merge: