Joe's
Digital Garden

Git Grimoire

Frequently Googled

Squash the Last X Commits Together1

git rebase -i HEAD~X
git rebase -i <SHA1-HASH>

Starts an interactive rebase on the last X commits or back to the hash specified.

External References

  1. Anomie. Squash my last X commits together using Git, StackOverflow. Retrieved 2020-11-03.

Linked References