0

With github, I've got a contributor who opened a PR. I cloned their branch, and have now made my own changes on top of their original changes.

I want to push my local changes to his branch, so that they appear on the PR. I can do this via the github UI by clicking "edit file", but I can't figure out how to do this without them giving me push access to their fork?

beyarkay
  • 513
  • 3
  • 16
  • Submit a pull request to *their* repository and have them merge your changes? – chepner Apr 07 '23 at 13:53
  • That seems awefully indirect ): So there's no way to force push my changes onto their PR? (even though the base repository is my own) – beyarkay Apr 07 '23 at 14:15

1 Answers1

1

You need to add their remote first so you can checkout and commit to the branch. However, they must have checked the "Allow edits by maintainers" option when creating the PR (it's checked by default).

After adding the remote, just checkout the branch using the newer switch command. It should automatically know that the branch is on the upstream/fork remote.

$ git remote add FORK_NAME FORK_URI
$ git switch FORK_BRANCH

You can read more detailed instructions here on the GitHub Docs page.

Hank
  • 1,976
  • 10
  • 15