Interactive rebase of a branch with its point of divergence from master

I only found one iterative improvement to the command you listed. Your command:

git rebase -i `git merge-base my_branch master`

An improvement would be to not have to remember the name of the branch you want to rebase. Assuming you're currently on the branch you want to rebase (which is almost always the case in my experience), you could use:

git rebase -i `git merge-base HEAD master`

Maybe I'm misunderstanding your question, but I think git rebase -i master should do what you want. It will figure out the merge base and rebase the entire branch from that point to the current HEAD so that it appears to have been branched from the current tip of master.

Also, if master has not advanced, then rebasing will pretty much be a no-op.

Tags:

Git

Rebase