Git出现冲突error: Your local changes to the following files would be overwritten by merge
程序员文章站
2022-07-13 21:12:11
...
1、出现原因:其他人修改了xxx.java文件并提交到版本库中去了,而你本地也修改了xxx.java文件,这时候你进行git pull操作就出现冲突了
2、解决方法,在上面的提示中也说的很明确了。
保留本地的方式修改(强烈推荐,还有一种是直接拉取服务器的(不推荐使用就不写了),这样你本地修改的代码的,就会舍弃,相当于你写的代码直接没,你还的重新写)
步骤如下:
a、通过git stash将工作区恢复到上次提交的内容,同时备份本地所做的修改
git stash
b、之后就可以正常git pull了git
git pull
c、pull完成后,执行git stash pop将之前本地做的修改应用到当前工作区
git stash pop
上一篇: git:error: Your local changes to the following files would be overwritten by merge:
下一篇: 框架基础了解
推荐阅读
-
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 merge 报错:error: Your local changes to the following files would be overwritten by m
-
git 删除本地修改 Your local changes to the following files would be overwritten by merge
-
git pull 提示错误,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:
-
git pull 提示错误,Your local changes to the following files would be overwritten by merge