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