Skip to content

Instantly share code, notes, and snippets.

@kevinhooke
Created March 20, 2025 15:52
Show Gist options
  • Save kevinhooke/f9fb36682a1220ce01442f97ad9aedca to your computer and use it in GitHub Desktop.
Save kevinhooke/f9fb36682a1220ce01442f97ad9aedca to your computer and use it in GitHub Desktop.
git squash commits
#To squash previous commits to a single commit
git rebase -i HEAD~[number of previous commits to squash]
#From the interactive list, each of the commits will be listed as 'pick'. Choose one of the commits into which
#the others should be merged, leave that as 'pick', and change all the others to 's' or 'squash'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment