Squashing Commits history git checkout my_branch git rebase -i HEAD~4 // Change the pick to fixup for the commits you want to squash // If any conflicts occur git rebase --skip // Reset the rebase rm -fr ".git/rebase-merge" git push --force origin my_branch