git发生冲突:error: Your local changes to the following files would be overwritten by merge
2021-03-09 13:29
阅读:487
标签:file 使用 xxx class 修改 following lease 存在 基础
当使用 git pull 拉取代码时发生冲突报错:
error: Your local changes to the following files would be overwritten by merge: xxx/xxx.php Please commit your changes or stash them before you merge.
Aborting
出现这个情况是因为他人修改的xxx.php文件并提交到git库,与你本地的修改发生了冲突所以 git pull 失败,可以使用 git stash 解决:
1.通过 git stash 备份本地的修改,同时将工作区恢复到上次提交
git stash
2.使用 git pull 将git库代码拉取到本地
git pull
3.使用 git stash pop 将之前备份的修改在 git pull 拉取之后的基础上恢复到工作区
git stash pop
到这里就可以正常提交自己本地的代码库啦
git add -A git commit -m ‘ ‘ git push
如果存在多个备份可使用 git stash list 查看, git stash clear 清除所有备份
git发生冲突:error: Your local changes to the following files would be overwritten by merge
标签:file 使用 xxx class 修改 following lease 存在 基础
原文地址:https://www.cnblogs.com/52lnamp/p/12621456.html
下一篇:C#枚举
文章来自:搜素材网的编程语言模块,转载请注明文章出处。
文章标题:git发生冲突:error: Your local changes to the following files would be overwritten by merge
文章链接:http://soscw.com/essay/62305.html
文章标题:git发生冲突:error: Your local changes to the following files would be overwritten by merge
文章链接:http://soscw.com/essay/62305.html
评论
亲,登录后才可以留言!