Git pull -rebase does not work with conflict, but git push works

Yesterday we had such a strange situation with git:

  • We have created a branch of functions, as we always do. Then someone will work for several days in this branch of signs.

  • Meanwhile, something important happened on the main branch. These changes were necessary for the branch of signs.

  • Thus, we combined the leading branch into the function branch (without reinstalling, because our function branches are usually immediately transferred to the remote one, since we need to cooperate with the function). This merge was done only locally and has not yet been moved to the remote one.

  • Work on the function branch continued

  • When merging with master + with ongoing work, the local branch of new_feature properties is now ahead of origin / new_feature by 40 commits

  • Now we wanted to direct these 40 commits to the remote function branch. First we do git pull-rebase, as we always do before we push, because someone else could push some commits in front of us.

  • Now we are experiencing tons and tons of conflicts. We decided that we should not fix 40 commits and do git rebase-abort. Then we try git pull --no-rebase. We get: Already Updated - Strange

  • Since git status does not tell us that our local branch and the remote branch diverge, try git push

  • Git push works unexpectedly. We would refuse if we tried to click on the remote branch, which has changed since the last time we pulled. Thus, it is obvious that the remote has not changed, but git pull --rebase did something strange.

So it’s strange that

  • git pull --rebase " "

  • git pull -rebase , ( , )

?

+4
2

, , reerere 40 . , rebase, ! "git pull --rebase", git "git rebase origin/featureXY" (, featureXY). , , rebase . git , , rebase . . , , , . .

: ! pull-rebase.

+2

, a rebase a git merge , git rerere. . git rebase git

+1

All Articles