git rebase in plain english
I often forget the purpose of the different parameters that can be fed to the ruby rebase
command. Here it s a handy translation to plain english and some notes:
This command:
git rebase --onto targetBranch fromBranch upToBranch
Reads in english as:
Grab commits from
fromBranch
untilupToBranch
and replay them on top oftargetBranch
.
Keep in mind that:
-
from
targetBranch
untilupToBranch
really means the rangetargetBranch..upToBranch
, which is commits present inupToBranch
excluding those present infromBranch
. - At the start of the command
upToBranch
will be checked out, and after the rebase it will be repointed to the last replayed commit. - If some changes are already present in
targetBranch
, for example due tocherry-pick
's, those commits will be skipped in the replay.
Written by Maic Lopez Saenz
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
khasinski
591.1K
dmichaelavila
500.4K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#