A pull request is a proposed change to a program's code that other developers read, test and approve before it joins the main code. GitLab and some other tools call it a merge request. The name comes from the request itself: the developer asks the team to "pull" the change into the main code. A pull request is the moment when one person's work is checked by others before it can reach customers.
Here is how it works in general. A team keeps its code in a code repository, a store that keeps every file with its full history. The version that the team trusts is called the main branch. A developer who wants to change something first makes a branch, a private copy of the code, and makes the change there. When the change is ready, the developer opens a pull request. It shows the exact lines added and removed, a short description of why, and usually a link to the ticket in the issue tracker that asked for the work. The CI/CD pipeline then builds the change and runs the automated tests on it. One or two reviewers read the changed lines, write comments on particular lines and ask questions. The developer answers and pushes fixes to the same pull request. When the tests pass and the reviewers approve, the change is merged, which means it is added to the main branch. From there, the pipeline can send it on to production, the live system that customers use.
Most teams set rules for this. For example, no one may change the main branch directly, every pull request needs at least one approval, and all tests must pass first. Small pull requests, of a few dozen lines, are reviewed faster and more carefully than large ones.
Take, for example, a bank's mobile-app team. Its rule may say that any change to the code that moves money needs two approvals, one of them from a senior engineer.
Consider an open-source library that thousands of companies use. A student in Bhubaneswar finds a bug and opens a pull request with a fix, and a maintainer of the library reviews it before accepting it.
Say a developer hands a task to an AI coding agent. The agent writes the change and opens a pull request, and an AI code review tool comments on it before a person approves it.
How is a pull request different from a commit? A commit is one saved step in the history of the code, with a short message. A developer may make ten commits on a branch while working. A pull request collects those commits into one proposal and adds the discussion, the test results and the approvals. A commit records a change; a pull request decides whether the change is accepted.
Appears in
- Code repository↗ DevOpsA code repository stores each pull request beside the main code, shows its changed lines, and merges it into the main branch only after the required reviewers approve it.
- Test orchestration↗ Software testingTest orchestration decides which tests to run for each new pull request and spreads them across many devices at once, so the developer sees the results in minutes.
- AI code review↗ AI codingAn AI code review tool reads each pull request as soon as it is opened, comments on bugs and missed cases, and summarises the change for the human reviewer.
- AI coding agent↗ AI codingAn AI coding agent ends its task by opening a pull request with the change and the tests it wrote, so that a person can review the work before it is merged.