Committing changes to a pull request branch created from a fork

Hi,

I checked out a PR using “gh pr checkout 95” and wanted to add a few changes. The contributor had already enabled “Allow edits from maintainers”.
When I run ‘git push’, I get this error:

$ git push
Pushing to git@github.com:1ndy/hgeometry.git
ERROR: Authentication error: Authentication required: You must have push access to verify locks
error: failed to push some refs to 'git@github.com:1ndy/hgeometry.git'

Then I tried cloning the contributor’s fork and pushing my changes there which worked perfectly. So my question is this: Can I push changes to PRs that I’ve checked out with the GitHub CLI in my own repo or do I need to create a separate clone for each contributor?
Thanks.

2 Likes

Welcome @Lemmih! I took a look and it seems that you have permissions to push to noinia/hgeometry, but not the fork 1ndy/hgeometry. If you want to push to 1ndy/hgeometry you will need to be granted permissions as a collaborator on that repository as well.

Let me know if you have any other questions about this.

1 Like

Hi Steve,

I do have access to the specific branch on 1ndy/hgeometry. If I pull the repository and push to the monotone-polygon branch then everything works exactly as documented here: Allowing changes to a pull request branch created from a fork - GitHub Docs

My question is about whether I have to clone 1ndy’s repository or if I can just use gh pr checkout 95 in my own repository and then push directly to 1ndy’s. It would be convenient if I could checkout his branch, make changes, and then push them back to him without having to make a separate clone of the repository.

I’m seeing the same issue.

I found another bug report experiencing the same problem: [bug] PR edit permissions not working on fork of fork