openGauss
开源数据库
openGauss社区官网
开源社区
当使用git出现冲突提示时如果解决?
2022-09-01git
当使用 git 出现冲突提示时如果解决?
背景介绍:
在使用 git 工具时,遇到如下错误。
报错内容:
bash
error: Your local changes to 'c/environ.c' would be overwritten by merge. Aborting.
Please, commit your changes or stash them before you can merge.
报错原因:多人编辑了同一个文件,并提交即会产生冲突
解决办法:
拉取远程分支
git fetch upstream
寻找冲突文件
git rebase upstream/master
修改冲突文档。
修改完成后,执行如下命令
git rebase --continue
添加更新后的文档到缓存区。
git add .
将文件推送到远程仓库
git push 或 git push --force