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?
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.
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.
You can revert a pull request after it's been merged to the upstream branch.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With