Skip to content

Instantly share code, notes, and snippets.

@darnould
Last active August 28, 2025 08:34
Show Gist options
  • Select an option

  • Save darnould/bc4120b36ecf667149e5 to your computer and use it in GitHub Desktop.

Select an option

Save darnould/bc4120b36ecf667149e5 to your computer and use it in GitHub Desktop.
Merging PRs from forks (using squash)

Squash-merging PRs from forks

This example uses PR #2. Replaces all instances of 2 with the ID you're looking to merge (using squash).

  • git checkout master
  • git fetch origin pull/2/head:2
  • git merge --squash 2
  • git commit
  • git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment