Squashing commits

git

Before opening a pull request squash commits in your branch to have a cleaner history. Here is how to squash the last 5 commits:

git reset --soft head~5
git commit -m 'my new commit message'

Note that if you have already pushed your branch to remote you will see a warning that your branch and origin have diverged and you can use git pull to merge the remote branch into yours. Do not pull and instead use git push --force to update the remote branch. More info