Skip to content

Instantly share code, notes, and snippets.

@michaellopez
Last active December 14, 2015 09:18
Show Gist options
  • Select an option

  • Save michaellopez/5063584 to your computer and use it in GitHub Desktop.

Select an option

Save michaellopez/5063584 to your computer and use it in GitHub Desktop.
Squash Github pull request to 1 commit
// Revised from http://blog.steveklabnik.com/posts/2012-11-08-how-to-squash-commits-in-a-github-pull-request
git fetch upstream
git checkout <branch name>
git rebase upstream/master -i
# choose squash for all of your commits, except the first one
# Edit the commit message to make sense, and describe all your changes
git push origin <branch name> -f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment