遇到Your branch and 'origin/xxxx' have diverged, and have 3 and 9 different commits each, respectively.问题的分析及解决方法

背景

如题

分析

遇到该问题原因,是本地分支与对应远程分支的commit存在diff,俗称分支分叉。

如何解决

把本地分支与远程分支存在的diff解决掉

1. 把本地分支强推到远程分支: git push origin branch_xxx -f

2. 把远程分支rebase到本地分支

参考

  1. https://www.jianshu.com/p/21af39fc854e
  2. https://blog.csdn.net/d6619309/article/details/52711035
  3. https://my.oschina.net/u/588516/blog/1527398
原文地址:https://www.cnblogs.com/syw-home/p/14793086.html