git rebase -i --update-refs HEAD~3

Category: Git - Advanced

git rebase -i --update-refs HEAD~3

Rebase while keeping stacked branches updated

During an interactive rebase, --update-refs also moves any branch that points at a rebased commit, so stacked branches follow their base. Without it those branches keep pointing at the old commits. It only affects local branches.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.