Rewrite recent commits interactively
CautionOpens an editor listing the commits after the base, where you can reorder, squash, edit or drop them.
git rebase -i HEAD~3Edit the highlighted values, then copy. They are inserted as typed, without shell escaping.
Report an issue (opens in a new tab) wrong command, wrong danger level, typo… (on GitHub)
Adapted from tldr-pages (common/git-rebase.md), licensed under CC BY 4.0.