Add Squashed commit to github Pull Reques

If you have multiple commits in a branch that was commited as Pull Request to github but you need them to appear as one commit:

$ git checkout feature-branch
$ git rebase -i master

This will open your favorite text editor, leave the original commit as “pick” and change the others to “squash”

pick ce1c651 fixing actual problem
pick ce1c652 trivial change
pick ce1c653 trivial change 2

Change to:

pick ce1c651 fixing actual problem
squash ce1c652 trivial change
squash ce1c653 trivial change 2

Then push to github

$ git push --force

And be happy :D