简介: 使用git pul
l出现error如下:其解决方法
error: Your local changes to the following files would be overwritten by merge:
xxx/xxx/xxx.java Please, commit your changes or stash them before you can merge. Aborting
本博文的简述or解决问题?
git
十分常用命令:团队协作中,开发过程中,会经常遇到使用的命令
编程环境: deepin 15.11 x64 专业版
Kernel: x86_64 Linux 4.15.0-30deepin-generic
同步博文:
- 本篇的csdn/github.io同步博文: git pull失败原因和解决
git pull失败原因和解决:
pull
更新代码,遇到了下面的问题:
error: Your local changes to the following files would be overwritten by merge:
xxx/xxx/xxx.java Please, commit your changes or stash them before you can merge. Aborting
解决方案:
- 放弃本地修改,直接覆盖之
git reset --hard
git pull
- 或
stash
git stash //保存贮藏
git pull //拉取
git stash pop //弹出贮藏 (此时会将更新的代码和自己写的代码合并,可能会有冲突,需要手动解决冲突)
参考博文:
因为有着许许多多的热心网友的无私分享,从他们的博客中学习成长,学会很多,故也不辞辛苦也将自己的项目或经验整理成博客的形式,也提供给一起大家学习探讨与交流
参考: