How can I squash my last X commits together into one commit using Git?
If for example, you want to squash the last 3 commits to a single commit in a branch (remote repository) in for example: https://bitbucket.org
What I did is
git reset --soft HEAD~3
git commit
git push origin --force