Git命令使用出现Automatic merge failed; fix conflicts and then commit the result.解决方法
产生原因这个问题产生的原因是因为git pull 的时候会分为两步,1、先从远程服务器上拉下代码;2、进行merge。merge时候失败了,就会出现“Automatic merge failed; fix conflicts and then commit the result。”解决方法:丢弃本地提交,强制回到线上最新版本git fetch --allgit reset --hard origi
文章共133字 · 阅读需要大约1分钟
一键AI生成摘要,助你高效阅读
问答
·
产生原因
这个问题产生的原因是因为git pull 的时候会分为两步,
1、先从远程服务器上拉下代码;
2、进行merge。
merge时候失败了,就会出现“Automatic merge failed; fix conflicts and then commit the result。”
解决方法:
- 丢弃本地提交,强制回到线上最新版本
git fetch --all
git reset --hard origin/你需要下拉的分支(默认master)
git fetch - 保存本地提交
git reset --abort
git reset --merge
git commit -am '提交信息'
git pull
更多推荐
已为社区贡献2条内容
所有评论(0)