Skip to content

Instantly share code, notes, and snippets.

robertpainsi /
Last active June 11, 2024 13:24
How to reopen a pull-request after a force-push?

How to reopen a pull-request after a force-push?


  • You need the rights to reopen pull requests on the repository.
  • The pull request hasn't been merged, just closed.


  1. Write down the current commit hash of your PR-branch git log --oneline -1 <PR-BRANCH>
  2. Write down the latest commit hash on github before the PR has been closed.
  3. git push -f origin :
n00neimp0rtant / gist:9515611
Last active March 14, 2024 06:30
simple squash without rebase
## within current branch, squashes all commits that are ahead of master down into one
## useful if you merged with upstream in the middle of your commits (rebase could get very ugly if this is the case)
## commit any working changes on branch "mybranchname", then...
git checkout master
git checkout -b mybranchname_temp
git merge --squash mybranchname
git commit -am "Message describing all squashed commits"
git branch -m mybranchname mybranchname_unsquashed
git branch -m mybranchname