GIT代码冲突解决方法记录

来源:互联网 发布:python版本选择 编辑:程序博客网 时间:2024/06/03 19:36

冲突提示信息


error: Your local changes to the following files would be overwritten by merge:
        ......
Please, commit your changes or stash them before you can merge.


如果想要和本地代码合并,github代码库和本地代码自动merge,可以用以下命令:

git stashgit pullgit stash pop

然后再用git diff -w查看代码合并情况,如果装了乌龟的话可以直接diff手动解决冲突


如果是想用github最新代码完全覆盖本地的代码,就是说你本地的修改不要了,那可以这样干:

git reset --hardgit pull
这样本地代码就跟github上保持一致了

原创粉丝点击