Skip to content

Instantly share code, notes, and snippets.

@tilleps
Last active February 29, 2020 06:17
Show Gist options
  • Save tilleps/d79a5213f59d4931c7cfc0e977477b3e to your computer and use it in GitHub Desktop.
Save tilleps/d79a5213f59d4931c7cfc0e977477b3e to your computer and use it in GitHub Desktop.
Alternative to Git Squash
# https://stackoverflow.com/a/3143485/2424549
# create a new branch
git checkout -b new_clean_branch
# apply all changes
git merge original_messy_branch
# forget the commits but have the changes staged for commit
git reset --soft master
git commit -m "Squashed changes from original_messy_branch"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment