This article covers how to draft pull requests in GitHub. GitHub users are able to directly create pull requests to a branch for a particular GitHub repository code so that others can be made aware of the changes and they can do the collaboration and improvements. What if you haven’t added any changes yet or just started working on the code improvement or want to start a new pull request but haven’t started anything. In that case, the draft pull request will be very useful.
This draft pull requests feature to a branch in GitHub is introduced recently. Yes, it is the native feature of GitHub. By drafting a pull request, you can let others know that your work is in progress related to that pull request. Others will also be able to see that there are some checks that haven’t been completed yet. This draft pull request feature is available for any code available publicly, private repositories (for groups), and open source repositories.
In the screenshot above, you can see that a draft pull request is generated. It can’t be merged until it is ready for review. While on the other hand, a pull request (not set as drafted) is ready to review and can be merged into the branch.
How to Draft Pull Requests in GitHub?
Step 1: Access any of your repositories. It doesn’t matter if it is your own repository or a forked repository.
Step 2: Go to Pull requests tab and then create a new pull request for a branch.
Step 3: Add title, comment, attach files, etc., for the new pull request. Now, on the bottom part of the pull request, you will see a drop-down button in green color. Use that button and “Create Draft Pull Request” option will be visible to you. Use that option and press Draft Pull Request button.
That’s it! You’ve successfully created a draft pull request. Other users will be able to see that it is a work in the progress pull request.
The Conclusion:
Recently, GitHub introduced the feature to create private GitHub repositories for free. Now, this draft pull requests in GitHub feature is going to make this platform more useful. This is a straightforward way to let others see that there is some pull request but it is still in the work in progress mode and collaboration is not needed. Try it.