Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode's "rebase local changes onto upstream changes"?

Tags:

git

xcode

What "rebase local changes onto upstream changes" in Pull menu option mean? Can it possibly anyhow change remote branches?

like image 280
jazzandrock Avatar asked Oct 09 '18 10:10

jazzandrock


People also ask

Does rebase overwrite changes?

If another user has rebased and force pushed to the branch that you're committing to, a git pull will then overwrite any commits you have based off that previous branch with the tip that was force pushed. Luckily, using git reflog you can get the reflog of the remote branch.

Does rebase change remote?

No, locally rebasing doesn't change the remote.


1 Answers

Looks like it is doing git pull --rebase (vs just git pull).

Consider this:
remote origin/master has commits: c1 -> c2 -> c3
and your local master looks like: c1 -> c2 -> c4

If you don't use "Rebase" option, Pull will merge c3 into your c4 commit.
With "Rebase" - Pull will first copy c3 to your local master and keep c4 clean and on top: c1 -> c2 -> c3 -> c4

In this example I believe "rebase local changes onto upstream changes" should be preferred.

like image 158
Dima G Avatar answered Sep 23 '22 05:09

Dima G