Skip to content

Instantly share code, notes, and snippets.

@vasanthk
Last active August 29, 2015 14:23
Show Gist options
  • Save vasanthk/ea4b32769689c76aa4a3 to your computer and use it in GitHub Desktop.
Save vasanthk/ea4b32769689c76aa4a3 to your computer and use it in GitHub Desktop.
Squash PR commits into a single commit
git fetch upstream
git checkout mybranch
git merge upstream/master
# if necessary, resolve conflicts and git commit
# ...
git reset --soft upstream/master
git commit -am 'Some cool description for a single commit'
git push -f
Note that it's super important that you merge before resetting, and that the argument is the same master branch.
Otherwise you risk messing up your local history.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment