Another way to squash all your commits is to reset the index to master: git checkout yourBranch git reset $(git merge-base master $(git branch --show-current)) git add -A git commit -m "one commit on yourBranch"