Suppose I did git pull --rebase , as a result of which my commits (s) moved up, moving the pointer (“branch”).

After I do git push , will the remote branch be the same as the local branch?

  • if the old commits did not change during the rebuy (that is, it was fastforward, as git pull would write about), then the answer is yes, it will be the same as the local one. - KoVadim
  • @KoVadim so with --rebase it just leaves the old commits as it is, and all subsequent sprays to the top of this branch. Or am I missing something? - D-side
  • if I read the documentation correctly, then git will try to do this, but anything can happen. - KoVadim 2:46 PM

1 answer 1

As far as I understand:

  • if the pull --rebase completed successfully (or the conflicts that occurred were resolved by editing, adding files to the index ( add ... ) and then performing a rebase --continue )
  • if the push command completed successfully (the remote branch did not “move” during this time due to the addition of new commits or even (partial) rewriting of the history)
  • then both the branch in your local and the branch in the remote repository will point to the same commit. which guarantees the complete identity of the entire commit tree for which this commit is a “tip” (the fact that in these two repositories history can have different “depths”, in this case, I think, can be neglected).