Let's say contributor has submitted a pull request to your (author) project (repo). They have made changes on their
branch feature and have proposed to merge this into origin/master, where
origin -> https://github.com/author/repo.gitNow say you would like to make commits to their PR and push those changes. First, add their fork as a remote called
contributor,
> git remote add contributor https://github.com/contributor/repo.git such that,
> git remote -v
origin https://github.com/author/repo.git (fetch)
origin https://github.com/author/repo.git (push)
contributor https://github.com/contributor/repo.git (fetch)
contributor https://github.com/contributor/repo.git (push)Next, pull down their list of branches,
> git fetch contributorand create a new branch (contributor-feature) from the branch that they have created the PR from,
> git checkout -b contributor-feature contributor/featureNow make any changes you need to make on this branch. If you'd like to rebase this PR on top of the master branch of the primary repository,
> git rebase origin/masterFinally, push the changes back up to the PR by pushing to their branch,
git push contributor contributor-feature:featureNote that if you did a rebase, you'll need to add the --force (or -f) flag after push. The author of the PR
also may need to explicitly allow you to push to their branch.
Related, If the contributor does not allow you to push to their branch, you can "commandeer" the PR using this:
https://stackoverflow.com/questions/66539231/how-to-change-the-owner-of-a-pr-on-github-how-to-commandeer-an-open-github-pr