Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you attach a new pull request to an existing issue on github?

I'm not sure, but I have a vague memory of creating a github pull request with "Issue 4" or something in the title, and it automatically attached itself to Issue 4 in the project that I was submitting it to. I tried it again recently and it didn't work -- it just created a brand new issue instead. I don't see any options like "Attach to issue" on the new pull request page, nor "Open a new pull request for this issue" on the issue page. Is there any way to do this, to help project owners keep their Issues page clean and avoid duplication?

Edit: To clarify, I know that creating a pull request always creates a new issue. I would like to instead attach the pull request to an existing issue.

like image 520
Tyler Avatar asked Dec 25 '10 00:12

Tyler


People also ask

How do I add to an existing pull request?

To make changes to an existing pull request, make the changes to your local branch, add a new commit with those changes, and push those to your fork. GitHub will automatically update the pull request.

How do I add a pull request to GitHub?

To attach a file to an issue or pull request conversation, drag and drop it into the comment box. Alternatively, you can click the bar at the bottom of the comment box to browse, select, and add a file from your computer. Tip: In many browsers, you can copy-and-paste images directly into the box.


1 Answers

Adding a pull request to an existing upstream issue is easy assuming you forked using the normal github means.

Simply reference the issue in your commit message using any of the supported keywords:

  • close
  • closes
  • closed
  • fix
  • fixes
  • fixed
  • resolve
  • resolves
  • resolved

For example: "this commit fixes #116"

The text referencing the issue does not need to appear in the subject line of your commit.

Push your commit to your github repo and the pull request will be automatically appended to the issue.

Note: While it is not required, it is strongly recommended that you commit anything that will be part of a pull request to a separate branch specific to that issue, because future commits on that branch will be appended to the pull request (automatically by github). So, if you didn't make a separate branch, left it on master, and then kept developing, then all your unrelated commits to master would get appended to your pull request.

like image 94
3 revs, 3 users 52% Avatar answered Sep 21 '22 17:09

3 revs, 3 users 52%