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
fromBranchuntilupToBranchand replay them on top oftargetBranch.
Keep in mind that:
-
from
targetBranchuntilupToBranchreally means the rangetargetBranch..upToBranch, which is commits present inupToBranchexcluding those present infromBranch. - At the start of the command
upToBranchwill 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
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#