总体步骤如下:

  • git pull --rebase    
  • 解决冲突文件 file1.c。
  • git add file1.c
  • git commit -m "*****"   
  • git push
  • git rebase --continue ,此时冲突消失
  • 强推,git push origin xxxx -f 

本人解决的例子如下:

第一步、拉取最新代码

git pull --rebase 后进入冲突状态。分支名后多了REBASE 1/1 

第二步,使用notePad打开冲突文件解决冲突并保存。

此过程省略。

第三步,修改完冲突文件后git add 和git commit

git commit,此时将所有代码提交,只生成一个commit 节点。

第四步 git push

5 git rebase --continue git push origin xxxxx -f

Git rebase  --continue后,冲突消失。

此时PR上还是没有最新代码。需要再次强制push。

结束。PR上冲突解决。

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐