What is a pull request?
Whether you’re collaborating on a work assignment with colleagues or contributing to an open-source project, chances are that you will be operating in the following scenario. You make local code changes and then submit those changes to a remote project maintainer for review before those changes are implemented, or merged.
This is called a pull request; you are requesting that someone reviews and approves your changes before they become final.
Watch this video to learn more about what a pull request is, or keep reading.
If you haven’t already started using the GitKraken Git Client to make pull requests easier, download it for free now!
While pull requests are not a core feature of Git, they are commonplace when it comes to collaborating with Git hosting services. They are especially necessary when working with open-source projects.
Let’s say, for example, that you want to contribute to your favorite open-source project in GitHub. Most open-source projects have a maintainer who can control which changes are approved and merged into the project. They have the control to approve and decline changes as they wish.
How do I get changes approved with a pull request?
After forking the repository on the remote hosting service and cloning it to your local machine, you can start working on making changes to the code.
After you’re happy with the changes, you can push the work up to your fork and open a pull request that will signal the main repo. This pull request asks the maintainer(s) to review your work, provide comments, request edits, etc.
If your pull request is approved, the maintainer will merge your changes into the main repo.
How do I use pull requests in GitKraken?
GitKraken supports pull requests from the following Git hosting services:
- GitHub.com & GitHub Enterprise
- GitLab.com & GitLab Self-Hosted
- Bitbucket.org & Bitbucket Server
- Azure DevOps
After you’ve cloned a repo in GitKraken, it will appear as a remote on the left panel of your workspace.
When you’re ready to submit your changes for approval, you can drag-and-drop your feature branch onto the target branch of the main repo to trigger the pull request option from the dropdown menu. You can also access pull requests by clicking the green + icon on the Pull Requests section on the left panel.
After opening the pull request, fill in the details, like Title, Description, Reviewers, etc. and hit Create Pull Request.
You will see a blue notification bubble in the top right giving you the option to directly open the pull request from the remote service’s page for review.
Not so bad, right?
Why should I use pull request templates?
Many repos have guidelines for submitting pull requests, requiring the inclusion of a description which should clearly describe what the maintainer can expect when reviewing the code and any standards you, as the developer, have considered before submitting the pull request.
Some projects may even require the use of formalized templates in order to submit proposed changes. A template could include a description checklist, requesting details such as:
- How a bug was fixed or summary of a new feature.
- Unit test cases.
- Whether it was tested on all devices and browsers.
Learn more about enhancing pull request descriptions using templates, and how to create them in GitHub and GitLab.
How do I use pull request templates in GitKraken?
Accessing and utilizing pull request templates in GitKraken is a breeze.
When creating a new pull request in GitKraken, the Pull Request Template dropdown menu will appear, giving you the option to select a pull request template you’ve created in one of your repos.
You can then fill out the template and submit your pull request from within GitKraken. Easy as that!
Providing the maintainer with concise information and helpful context will give you the best chances of having your pull request approved and merged into the project.
Stay on the cutting edge of software development by getting innovative tips, trends and stories delivered to your inbox every month!