当前位置:   article > 正文

Your branch and ‘origin/master‘ have diverged,and have 1 and 353 different commits each, respective_:have 5 and 3 different commits each, respectively

:have 5 and 3 different commits each, respectively

今天打开以前的一个项目,其他同事在维护,自己想更新下最新代码,然后执行拉取了下,竟然报错了:

  1. git pull origin master
  2. From ssh://test.com:1198/~test/test
  3. * branch master -> FETCH_HEAD
  4. Auto-merging pom.xml
  5. CONFLICT (content): Merge conflict in pom.xml
  6. Auto-merging test-parent/pom.xml
  7. CONFLICT (content): Merge conflict in test-parent/pom.xml
  8. Removing test-stu/.gitignore
  9. Auto-merging test-core/pom.xml
  10. CONFLICT (content): Merge conflict in test-core/pom.xml
  11. Automatic merge failed; fix conflicts and then commit the result.

然后clean了下:git clean -f   

再次拉取依然报错

接着按照提示:git merge --abort  

报错信息依旧

然后,查看了下状态

  1. git status
  2. On branch master
  3. Your branch and 'origin/master' have diverged,
  4. and have 1 and 353 different commits each, respectively.
  5. (use "git pull" to merge the remote branch into yours)
  6. nothing to commit, working tree clean

由于之前本地修改过代码并提交过,且服务器上代码重构优化变动非常大,不想花时间处理冲突了,果断还原,还原方式如下:

  1. 1> git rebase origin/master
  2. Successfully rebased and updated refs/heads/master.
  3. 2、git pull --rebase
  4. remote: Enumerating objects: 402, done.
  5. remote: Counting objects: 100% (348/348), done.
  6. remote: Compressing objects: 100% (187/187), done.
  7. remote: Total 210 (delta 91), reused 0 (delta 0)
  8. Receiving objects: 100% (210/210), 20.74 KiB | 558.00 KiB/s, done.
  9. Resolving deltas: 100% (91/91), completed with 28 local objects.
  10. From ssh://test:1198/~test/test
  11. * [new branch] 10.0.1.1 -> origin/10.0.1.1
  12. * [new branch] 8.6.1.1 -> origin/8.6.1.1
  13. * [new tag] 10.0.0.1 -> 10.0.0.1
  14. * [new tag] 5.0.2.1 -> 5.0.2.1
  15. Already up to date.
  16. 3>git push origin master
  17. Everything up-to-date
  18. 4>git status
  19. On branch master
  20. Your branch is up to date with 'origin/master'.
  21. nothing to commit, working tree clean

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/花生_TL007/article/detail/559137
推荐阅读
相关标签
  

闽ICP备14008679号