50% off your 1st seat of GitKraken Pro — only $4/month!

What is a Pull Request in Git?

Intermediate Git Tutorial

As a developer working with Git, you might wonder – what exactly is a pull request in Git? Understanding pull requests is crucial for collaborating effectively with your team. In this guide, we’ll explore pull requests’ purpose, best practices, and how to use GitKraken to streamline the process.

What is a Git Pull Request?

A pull request, often abbreviated as PR, serves as a proposal to merge changes made in one branch of a repository into another, typically from a feature branch into the main branch. Pull requests are essential for facilitating code reviews, encouraging collaboration, and maintaining a clean, well-documented codebase.

Pull Request Examples

  • Feature Additions: A developer adds a new feature, like password reset, and creates a pull request to merge it into the main branch after approval.
  • Bug Fixes: A separate branch is made to fix a discovered bug, and a pull request is created for team review and integration.
  • Code Refactoring: Developers refactor code for better performance or readability and submit a pull request for team approval.
  • Dependency Updates: After reviewing for compatibility and improvements, a pull request updates the project’s dependencies to the latest versions.

When working with pull requests, GitKraken clearly displays which branch you’re on and which branch the PR refers to, something even advanced Git users commonly get wrong.

How to Create a Pull Request in Git

If you have changes ready to submit for approval on GitKraken Client, you can drag-and-drop your feature branch onto the target branch of the main repo to trigger the “Create a pull request” option from the drop down menu.

You can also initiate this process by clicking the green + icon on the Pull Requests section on the left panel.

To complete the process of creating your PR, simply hit Create pull request at the bottom of the Git pull request template. Not so bad, right?

Pull Request Integrations in GitKraken

GitKraken supports pull request integrations with the following remote hosting services:

After you’ve used one of the above integrations to Git clone a repository, the repo will appear as a remote on the left panel of your central graph.

Having the immediate visual context of your available remote repos listed clearly in the GitKraken UI makes performing actions on those remotes safer.

Git Pull Request Template

GitKraken supports Git pull request templates when creating new PRs, allowing you to specify details such as title, description, reviewers, and labels.

Make the process of creating Git pull requests easier and streamline PR templates across your team using the legendary cross-platform GitKraken Git GUI, available for free download.

Pull Request FAQs

How to Approve Pull Requests in GitHub?

To approve a pull request in GitHub through GitKraken:

  • Open the pull request in the GitKraken Client.
  • Review the proposed changes using the built-in diff viewer and comments.
  • If you’re satisfied with the changes, leave a comment expressing your approval or click the “Approve” button.
  • Optionally, you can request changes or leave suggestions using the comment system.
  • Once approved, the project maintainers can merge the pull request into the target branch.
How to Edit a Pull Request?

You can’t directly edit a pull request once it’s created. However, you can make additional commits to the branch associated with the pull request to address feedback or make further improvements. The pull request will automatically update with these new commits.

How to Delete a Pull Request?

To close a pull request in GitKraken:

  • Open the pull request in the GitKraken client.
  • Click on the “Close Pull Request” button.
  • Confirm the action in the pop-up window to close and effectively delete the pull request.
How to Remove a Commit from a Pull Request?

In GitKraken, to remove a commit from a pull request:

  • Checkout the branch locally using GitKraken Client.
  • Use the interactive rebase feature in GitKraken to edit your commit history and remove the unwanted commit.
  • Force-push the updated branch to the pull request. GitKraken will update the pull request with the modified commit history.
Why is a Pull Request Called a Pull Request?

“Pull requests” refer to proposing changes from one branch to another. In GitKraken, you can initiate a pull request by right-clicking on the branch you want to merge and selecting “Start a Pull Request.” This action will prompt you to choose the target branch and create the pull request, just like in GitHub.

How to Resolve Conflicts in Git Pull Requests?

When conflicts occur in a pull request, GitKraken provides a visual tool to resolve them efficiently:

  • Open the pull request in GitKraken.
  • Click the “Resolve Conflicts” button next to the pull request’s merge status.
  • GitKraken will display the conflicting files and highlight the conflicting lines.
  • Use the built-in merge tool to resolve the conflicts by selecting the desired changes from each branch.
  • Commit the resolved changes and push them to the pull request branch.
What is Pull vs Push Request?

Though “pull request” and “push request” are often used interchangeably, there are noteworthy differences between them:

  • Pull Requests are specific requests to merge changes from one branch into another, often for code review and integration before merging.
  • Push Request is a less commonly used term referring to the direct pushing of code changes to a remote repository without prior review.
What is a Pull Request vs Commit?

A pull request is a request to merge changes from one branch to another, typically used for code review before merging. A commit represents a snapshot of changes at a specific time, providing a historical record of development.

Additional Resources

Table of Contents

Make Git Easier, Safer &
More Powerful

with GitKraken

Visual Studio Code is required to install GitLens.

Don’t have Visual Studio Code? Get it now.