Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert Github pull-request to issue

Tags:

github

Converting an issue to a pull-request is easy using the hub command:

hub pull-request -i 123

But how do you go the other way and convert a pull-request back into an issue?

like image 338
balexand Avatar asked Dec 17 '12 02:12

balexand


People also ask

How do you connect a pull request to an issue?

You can link a pull request to an issue by using a supported keyword in the pull request's description or in a commit message. The pull request must be on the default branch. If you use a keyword to reference a pull request comment in another pull request, the pull requests will be linked.

Can a pull request be merged without approval?

Repository owners and administrators can merge a pull request even if it hasn't received an approving review, or if a reviewer who requested changes has left the organization or is unavailable.

Can you reverse a pull request?

You can revert a pull request after it's been merged to the upstream branch.


1 Answers

You can't convert the pull-request back to an issue. The conversion to a pull-request is done by hub with the github api. There is no reverse feature in the api.

If however your intention is to remove commits from a pull-request, then you want to change the branch the pull-request is based off and do a git push -f.

Merging the request will only include the commits that are in the branch at the time of the merge. However, you can't fully hide these old commits. They are still seen in the history/comments of the pull-request.


You can delete the feature branch on github. The pull-request will contain the last known commits. If a pull-request is merged, changes in the feature branch afterwards have no effect on the request.


github-cli installs a tool called ghi to work with github issues from the command line, using the github api. However, since the api does not provide a "downgrade" of pull-requests to issues, this tool doesn't either.

like image 171
JonnyJD Avatar answered Oct 01 '22 15:10

JonnyJD