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

前端 未结 10 1909
抹茶落季
抹茶落季 2020-12-04 04:40

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

10条回答
  •  攒了一身酷
    2020-12-04 04:46

    You can create a Pull Request from an existing Issue with the Pull Request API:

    $ curl --user "smparkes" \
           --request POST \
           --data '{"issue": 15, "head": "smparkes:synchrony", "base": "master"}' \
           https://api.github.com/repos/technoweenie/faraday/pulls
    

    This creates a pull request:

    • ask technoweenie at project faraday (https://api.github.com/repos/technoweenie/faraday/pulls)
    • to pull from the synchrony branch in smparkes' fork ("head": "smparkes:synchrony")
    • to the master branch in technoweenie's fork ("base": "master")
    • and attach the pull request to issue 15 ("issue": 15)
    • with the pull request author smparkes (--user "smparkes")
    • you will be prompted for your GitHub password

提交回复
热议问题