Skip to content

Instantly share code, notes, and snippets.

Squashing commits the easy way

Rewriting history is only safe if no one depends on your branch.

So for example never do this on parent branches ie: develop, master, a feature branch with child branches, etc.

Example workflow:

  1. Make feature branch
  2. Haxxor
  3. Push to origin (optional but your dentist recommends you floss)
  4. Repeat steps 2 - 3 as necessary
  5. Squash commits using the function in this article