Skip to content

Instantly share code, notes, and snippets.

@Bunlong
Last active December 23, 2020 09:41
Show Gist options
  • Save Bunlong/80689f0e31818cf053bdf4072c6760ac to your computer and use it in GitHub Desktop.
Save Bunlong/80689f0e31818cf053bdf4072c6760ac to your computer and use it in GitHub Desktop.
Git squash all commits into single commit.

How to squash all commits into single commit?

Reset the index to master

git checkout yourBranch
git reset $(git merge-base master yourBranch)
git add -A
git commit -m "one commit on yourBranch"
git push --force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment