Push to pull request from fork but repo owned by Organization

I am the Admin of a repo that is under an organization. Another user (with read access only) submitted a pull request to the repo. I would like to make changes to the pull request before merging. I was able to fetch and checkout the pull request (git fetch pull/$id/head:$branchname), make changes locally and commit. However, I was not able to push it back to the pull request branch.

Do I need to get read & write access from the fork owner in order to update the pull request with my commits?

Thanks for helping! :smiley:

1 Like

The easiest thing you could do is to checkout via gh (e.g. gh pr checkout 1234). There might be pure git solutions, but it’s not worth the struggle imho.

After checkout (and your changes), you can simply do a git push to get your changes into the PR.

Hey there. That’s an interesting solution. I haven’t used gh at all before, but it is nice to know that’s an option now. I did get it working with git only, but had to request both read and write access to the forked repo. I was hoping that by checking that checkbox in the pull request (“Allow edits by maintainers”) I would have permission to push to that branch directly, without getting access to the remainder of the repo.

1 Like