Skip to content

Squashing the commits in a Pull Request

Maxim Belkin edited this page Oct 16, 2018 · 3 revisions

If you're asked to squash (all) the commits in your Pull Request, please follow the steps below:

  1. Checkout the branch you used for submitting the original Pull Request (your-PR-branch):
git checkout your-PR-branch
  1. Do a soft-reset to the beginning of the branch:
git reset --soft $(git merge-base gh-pages your-PR-branch)
  1. Create a new commit:
git commit -m "Your message"
  1. Push the changes to your fork:
git push --force your-fork

Clone this wiki locally