Skip to content
Careersbeginner

What is a pull request?

Updated Nov 30, 20263 min readBased on official documentation
What is a pull request?

In short

A pull request is a proposal to merge code changes into a project. It lets teammates see what changed, discuss it, and review it before the code becomes part of the main branch. Pull requests are a core collaboration feature on GitHub and similar platforms.

A pull request is a request to bring your code changes into a project. You write some code on your own copy of the work, then ask the people who maintain the project to look at it and merge it. The request gives everyone a place to talk about the change before it lands.

How it works

You start by making changes on a separate branch. A branch is a named line of work in Git, the version control system most teams use to track code. When the changes are ready, you open a pull request that asks to merge your branch into a base branch, often called main.

The pull request page gathers everything a reviewer needs in one place. It has several tabs:

  • The Conversation tab shows the description, comments, and reviews.
  • The Commits tab lists how the branch changed over time.
  • The Checks tab shows automated tests and builds.
  • The Files changed tab shows the diff, which is the line-by-line view of what changed.

A merge status area near the top of the page points out anything blocking the merge, such as missing approvals or failed requirements. Reviewers read the changes, leave comments, and ask for fixes. When the team agrees, someone merges the request.

Draft pull requests

A draft pull request is a pull request marked as work in progress. You can use drafts to share unfinished code and ask for early opinions without formally requesting a review. A draft cannot be merged. When you are ready, you mark it as ready for review, which asks the code owners to take a look. You can also turn a ready pull request back into a draft at any time.

Two ways teams use pull requests

The way you work with pull requests depends on how your project is organized. In the fork and pull model, outside contributors copy a project into their own fork, make changes there, and then open a pull request back to the original project. This is common in open source, because newcomers can work without needing write access first. We explain that workflow in our guide on how to contribute to open source.

In the shared repository model, everyone has push access to one repository. Each person creates a topic branch for their work and opens a pull request when it is ready. This model is more common with small teams and private projects. Teams that work this way often plan their work in short cycles, such as those described in our article on Scrum.

A simple example

Imagine you fix a typo in a README file. You create a branch called fix-typo, commit the change, and push the branch. Then you open a pull request titled Fix typo in installation steps. A teammate opens the Files changed tab, sees the one-line diff, and approves it. The merge button becomes available, and the change joins the main branch.

Common mistakes

Beginners often make pull requests too large. A huge change is hard to review, so reviewers may miss problems or take days to respond. Keep each request focused on one purpose.

Another common mistake is opening a request before the work is ready. Use a draft if you want feedback early. Finally, remember that a pull request is a conversation. Respond to comments clearly, and treat review as a way to improve the code rather than a judgment of you.

Why pull requests matter for your career

Pull requests show how you think about code, how you explain changes, and how you respond to feedback. Many hiring managers look at a candidate's public pull requests when they judge contributions. Learning to write clear descriptions and to review others' work well will help you in almost any software team. Pull requests also connect to operations work. Some teams review changes that affect production systems carefully, and their process can be linked to an on-call rotation for the people who respond to incidents.

FAQ

Do I need to know Git before I open a pull request?

Basic Git knowledge helps, especially creating branches and pushing commits. Most hosting platforms also offer web interfaces that cover the common steps.

Who can merge a pull request?

It depends on the project's rules. Some repositories let any user with write access merge after approval, while others limit merging to maintainers or require specific checks to pass first.

What is the difference between a draft and a regular pull request?

A draft is for work in progress and cannot be merged. A regular pull request is ready for review and can be merged once requirements are met.

Can I change a pull request after I open it?

Yes. You can push new commits to the same branch, and they appear in the pull request automatically.

Sources

This page is based on the official documentation below. Read it for full detail.

Pull request — official documentation ↗
blozhikDeveloper news from across the web, explained. Every story links to its original sources.