'Is there any way to make a draft pull request using git bash?
I want to make a draft pull request but when I execute the command git push --set-upstream origin new-branch
I could only see normal pull request button at my repository. Even though I've all the permission to the repository. So is there any way to make a draft pull request using git bash ?
Solution 1:[1]
Pull requests are not a Git feature, which means you literally cannot make them with Git.
You make pull requests on GitHub using GitHub features. As shown in the introduction, you do this on GitHub using the clicky buttons there: having done your git push origin
, you navigate to the correct page, start the process, then use the drop-down field to select the "draft" type of pull request.
Note that draft PRs are not available in all types of GitHub repository. For details, see the GitHub documentation on draft PRs.
Solution 2:[2]
A pull request generally is created when some unit of work which is ready to be used has been completed. In your case, you are sitting on some intermediate work, not yet ready to generate a pull request. Therefore, I would just suggest that you commit your work and push your branch to the repository. Most enterprise Git providers, such as BitBucket and GitHub, have features which would allow someone else to view a diff of your intermediate branch against some target branch. Based on this diff, they may give you feedback. All this can be done without creating a formal pull request.
Solution 3:[3]
Update May 2022: gh v2.10.0 comes with PR 5570:
"Submit as draft" option for pr create
-d, --draft
: Mark pull request as a draft
2020: A possible workaround, entirely done from your local workstation, is to use:
gh (GitHub CLI), to create a PR with
gh pr create
convert that PR to a draft with the extension
kyanny/gh-pr-draft
(mentioned incli/cli
issue 2271):gh pr-draft 1234
Once you are ready, using
gh pr ready
:gh pr ready 1234
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | torek |
Solution 2 | Tim Biegeleisen |
Solution 3 |