Can I rebase an incoming pull request?


Someone has submitted a pull request to one of my repositories and has allowed me to push new commits to it. I have updated the tests for my project and want them incorporated to the PR so I can make sure that merging the code won’t break anything. Is there a way I can rebase the PR on my master branch, or do I have to wait for the author to come online again and rebase it?


Hi @J-M0 thanks for stopping by the community!

You can definitely rebase it from that user’s fork. One way is to use the GitHub CLI tool.
Check out the Pull Request using the gh pr checkout [PR number] command.
From there, rebase as you normally would. Then push the updated branch to the repo with
git push -f to force the rewrite of the history.

Thank you for the answer @ernest-phillips!

It was surprisingly hard to find any information to this. GitHub’s own documentation doesn’t even cover it.