1

I have cloned a pull request according to the simple instructions here, and here.

I have edited the cloned PR locally, and now I want to merge it to be the new version of the software. How do I do this?

What I've tried so far

I tried the following

git add . 
git commit -m "minor edits to pr"
git push

and saw

fatal: The current branch pullrequest has no upstream branch. 
To push the current branch and set the remote as upstream, use 
git push --set-upstream origin pullrequest

So I then ran git push --set-upstream origin pullrequest

I now see

enter image description here

where the PR in the green box is the one i'm trying to edit and merge

stevec
  • 41,291
  • 27
  • 223
  • 311
  • Do you own the pull request highlighted in green? If not, that could explain why you're seeing what you've highlighted in red. Any changes pushed by the owner will be reflected if you choose to merge that pull request. Assuming you're not the owner, you've taken a copy of their branch, made some edits, and thus you must open a new pull request (unless you can push to the remote branch used to open the existing pull request). – miqh Feb 03 '20 at 03:14
  • @the pr in green is the one someone else made, and I cloned it, edited it, and I'm trying to merge the edited version. (the green pr appeared after I did the things I mention in the question - I'm not sure what it means) – stevec Feb 03 '20 at 03:15
  • @miqh [here](https://github.com/stevecondylios/netstat/pulls)'s the PR if it helps – stevec Feb 03 '20 at 03:17
  • 1
    Alrighty then. If the pull request was created with ["Allow edits from maintainers" option checked](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/allowing-changes-to-a-pull-request-branch-created-from-a-fork) then [this guide](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/committing-changes-to-a-pull-request-branch-created-from-a-fork) lays it out pretty well. Basically, you need to have pushed your additional commits directly on top of their forked branch for those changes to appear in the opened pull request (green). – miqh Feb 03 '20 at 03:33

1 Answers1

0

For anyone else, what I did was

  • merged the PR as-is, then
  • merged the PR I made (containing the edits) immediately afterward

This resulted in 2 pull requests (rather than rolling my edits into the original)

I couldn't work out out how to edit the original PR, although it is possible that as maintainer I did not have permission to do so. (although even that's unclear)

stevec
  • 41,291
  • 27
  • 223
  • 311