Pull Request
A Pull Request is a request to integrate changes into a project hosted in a version control system (e.g., GitHub, GitLab, or Bitbucket). With it, a developer asks the repository owners to review, discuss, and—upon approval—merge their changes into the main code branch.
What is a Pull Request
A Pull Request (literally, a “request to pull changes”) is a mechanism used in collaborative development to control code quality. A developer creates a separate branch, makes changes to it, and then uses a Pull Request to propose merging those changes with the main project branch (usually main or develop).
Simply put: A Pull Request is an “application” to add your code to the shared project, which other developers must review and approve.
How a Pull Request Works
The typical Pull Request creation process looks like this:
- Create a new branch from the main branch (main, develop).
Example: git checkout -b feature/add-login-form - Make changes — add files, modifications, tests.
- Commit changes and push to the remote repository:
git add .
git commit -m “Added login form”
git push origin feature/add-login-form - Create a Pull Request in the system (e.g., GitHub). Specify:
- Source branch — where the changes are located.
- Target branch — where the code should be merged.
- Description — what was changed and why.
- Code review. Other developers or a team lead check:
- Logic correctness.
- Compliance with coding standards.
- Presence of tests.
- Impact on existing functionality.
- Revisions and comments. If there are remarks, the author makes corrections and updates the PR.
- Merge. After approval, changes are merged into the main branch. The PR is closed, and the additional branch can be deleted.
Example: Creating a Pull Request on GitHub
- Go to the Pull requests tab → New Pull Request.
- Select the branch with changes (compare) and the target branch (base).
- Add a title and description (what, why, and which tasks it solves).
- Assign reviewers.
- Submit the PR for review.
After that, other participants can comment on code lines, leave feedback, and give approval (approve).
Structure of a Good Pull Request
A well-formatted PR should contain:
- Clear title. Example: Added Google OAuth authorization.
- Task description. What exactly was done and why.
- Context. Link to the related task (Jira, Trello, etc.) or the issue being solved.
- Testing instructions. How to test changes locally.
- Changes in dependencies. If libraries were added or configuration updated.
Advantages of Pull Requests
- Code quality control. All changes undergo review by other developers.
- Team transparency. Everyone sees which features and bug fixes are in progress.
- Change history tracking. The PR is saved in the repository history along with comments and task links.
- Early conflict detection. Conflicts between branches can be seen and resolved before merging.
- Learning and knowledge sharing. Code review helps newcomers adopt best practices from experienced colleagues.
Types of Pull Requests
| Type | Purpose |
| Feature PR | adding a new feature |
| Bugfix PR | fixing a bug |
| Refactor PR | improving code structure without changing logic |
| Hotfix PR | urgent fix for a critical bug in production |
| Docs PR | updating documentation |
Pull Request Best Practices
- Keep PRs small and specific — easier to review.
- Write informative descriptions (what and why was changed).
- Include the task or issue number.
- Add tests for new features.
- Assign reviewers — at least two for major changes.
- Before creating a PR — sync the branch with main (git pull origin main).
Pull Request vs. Merge Request
GitLab uses the term Merge Request, but essentially it’s the same as a Pull Request in GitHub. The difference is only in terminology:
| System | Term | Action |
| GitHub | Pull Request | “pull” changes from the author’s branch |
| GitLab / Bitbucket | Merge Request | “merge” changes into the target branch |
Typical Workflow with PR
text
main ← develop ← feature/add-login
↑
Pull Request → Code Review → Merge → Deploy
- Branch feature/add-login is created.
- Code is written.
- A Pull Request is created to the develop branch.
- After review and testing, the PR is merged.
- Changes then go to main and are deployed.
Tools for Working with Pull Requests
- GitHub / GitLab / Bitbucket — main platforms.
- Git CLI — creating and updating PRs via terminal.
- VS Code + GitLens / GitHub Pull Requests — plugins for review directly from the IDE.
- CI/CD (GitHub Actions, Jenkins, GitLab CI) — automatic code checks when creating a PR.
Conclusion
A Pull Request is a crucial tool for team development that ensures transparency, quality, and control over code changes. It helps teams work cohesively, identify errors before release, and maintain project stability.
