当前位置:   article > 正文

Git必知必会基础(13):远程冲突(conflicts)解决--rebase

git rebase 合并冲突

本系列汇总,请查看这里https://www.cnblogs.com/uncleyong/p/10854115.html

演示场景

虽然每次合并代码前会先把分支更新到最新,但是在你pull后到push前这段时间,可能其它小伙伴又push了,那么你的分支就不是最新的了

在push的时候就会失败,比如遇到这种提示信息:

  1. To gitee.com:qzcsbj/pytest_apiautotest.git
  2. ! [rejected] master -> master (fetch first)
  3. error: failed to push some refs to 'gitee.com:qzcsbj/pytest_apiautotest.git'
  4. hint: Updates were rejected because the remote contains work that you do
  5. hint: not have locally. This is usually caused by another repository pushing
  6. hint: to the same ref. You may want to first integrate the remote changes
  7. hint: (e.g., 'git pull ...') before pushing again.
  8. hint: See the 'Note about fast-forwards' in 'git push --help' for details.

本篇我们演示这种场景,并用rebase解决冲突。

git pull --rebase = git fetch + git rebase

数据准备

重新克隆

日志

远程分支qzcsbj.txt内容

commit id

其他人

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

闽ICP备14008679号