My eyes were opened on git-rebase when I read https://matthew-brett.github.io/pydagogue/rebase_without_tea...
The full version of the command as
$ git rebase --onto new-base start end
takes the commit range (start,end] and re-commits them on top of the new-base commit. The commit range doesn't have to be a full branch and you don't even need to be on the branch to run the command this way. It's very intuitive and I nearly always use the full version now.I've also gotten into the habit of "pinning" my branch before I rebase so that I have it in its original form. If the branch name is my-branch, then the command
$ git branch my-branch{-hold,}
which is a handy (bash-specific?) shortcut of $ git branch my-branch-hold my-branch
leaves you on my-branch and creates a new branch label called my-branch-hold that points to the same place.EDIT: clarification of pre-rebase branching