how to rebase git git rebase -i HEAD~$(git log master...HEAD --pretty=oneline | grep commit | wc -l | xargs) git fetch origin && git rebase origin/master git rebase --abort git add -p git push -u origin staging:MAAS-20 --force git commit -m '[whitespace] remove trailing whitespace' 579 git diff staging 580 git diff ..staging 538 git rebase -i upstream/master 539 git show 540 git show --stat 529 hub remote add -p -f cisco-cis 530 git remote rename cisco-cis upstream 531 cat .git/config 532 git subscribe-pulls upstream 533 git fetch upstream `git fetch cisco-cis; git rebase cisco-cis/master; resolve conflicts; git push -f ` ## Links https://robots.thoughtbot.com/git-interactive-rebase-squash-amend-rewriting-history https://www.kernel.org/doc/Documentation/SubmittingPatches http://stackoverflow.com/questions/1657017/how-to-squash-all-git-commits-into-one http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html