Skip to main content

Pull Request

Updated 2 min read

Share this page

Send the link, quote the definition with a link back, or show it as a card on your own site.

https://softwaredictionary.org/terms/pull-request

In short

A pull request is a proposal to merge changes from one branch into another, giving teammates a place to review, discuss, and test the code before it is merged.

What is a pull request?

A pull request, often shortened to PR, is how developers ask for their changes to be added to a shared codebase. You push a branch with your commits to a hosting platform and open a pull request asking to merge it into a target branch, usually main. The pull request shows exactly what changed, line by line, alongside a description of why.

Pull requests are the center of code review. Teammates can leave comments on specific lines, request changes, or approve the work. Most teams also connect pull requests to CI/CD pipelines, so automated tests and checks run on every update and must pass before the pull request can be merged.

Pull requests are a feature of hosting platforms such as GitHub, Bitbucket, and Azure DevOps, not of Git itself, and GitLab offers the same thing under the name merge request. The name comes from the idea that you are asking the project's maintainers to pull your changes into their branch.

Opening a pull request is like submitting an article draft to an editor. The editor reads it, suggests edits, and publishes it only once it meets the publication's standards. Small, focused pull requests are much easier and faster to review than large ones that change many things at once.

At a glance

A pull request: the branch fix/login-redirect, with commits D and E, is opened as a pull request into main; it collects review comments, passes its CI checks, is approved, and is then merged into main as commit M.open PRmergeABMmainDEfix/login-redirectPull requestfix/login-redirect → main2 review commentsCI checks passedApproved
A pull request is a gate: the branch reaches main only after people review it and the automated checks pass.

Key takeaways

  • A pull request proposes merging one branch into another.
  • It is the main place for code review, discussion, and approval.
  • Automated tests usually run on every pull request before it is merged.
  • GitLab calls the same feature a merge request.
  • Small, focused pull requests get reviewed faster and more thoroughly.

Example

Preparing a branch for a pull requestbash
# Create a branch and commit your work
git switch -c fix/login-redirect
git commit -am "Fix login redirect loop"

# Push the branch to the remote repository
git push -u origin fix/login-redirect

# Then open the pull request in your hosting platform's web UI,
# or from the terminal with its CLI tool (GitHub's is shown here)
gh pr create --base main --title "Fix login redirect loop"

Readers ask

What is the difference between a pull request and a merge request?

They are the same concept with different names. GitHub, Bitbucket, and Azure DevOps call it a pull request, while GitLab calls it a merge request.

Is a pull request part of Git?

Not really. Git has a git request-pull command that generates a summary of changes to send by email, but the interactive pull requests with reviews and comments that most developers use are features of hosting platforms built on top of Git.

How big should a pull request be?

As small as practical, ideally focused on a single change. Many teams aim for pull requests of a few hundred lines or fewer, because smaller changes are reviewed more carefully and merged sooner.

See also

Spotted a mistake or something missing on this page?Suggest an edit

Read a random page
Open today's review
Switch to the dark theme
Read this page in Türkçe

More

Settings