其他分享
首页 > 其他分享> > 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

作者:互联网

提交代码时发现报错 error: Your local changes to the following files would be overwritten by merge

提交背景:

团队其他成员修改了某文件并已提交入库,你在pull之前修改了本地该文件,等你修改完代码再pull时,这时会报错如下错误:

error: Your local changes to the following files would be overwritten by merge

解决方案:
执行以下三条命令

  1. git stash #封存修改
  2. git pull origin master
  3. git stash pop #把修改还原

作用:

标签:files,overwritten,git,would,pull,stash,Git,内容,提交
来源: https://blog.csdn.net/weixin_44552249/article/details/114962957