You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
A pull request (PR) — sometimes called a merge request on GitLab — is a formal proposal to merge one branch into another. It is the primary mechanism for code review and collaboration on platforms like GitHub. Pull requests allow teammates to discuss changes, suggest improvements, and approve work before it is merged into the main branch.
The typical team workflow using pull requests is:
git switch -c feature/user-profile
# ... make changes and commits ...
git push -u origin feature/user-profile
Then navigate to GitHub and click Compare & pull request.
A clear PR description speeds up review. Include:
Reviewers can leave inline comments on specific lines of code, approve the PR, or request changes. As the author, you respond to feedback by:
# Make the requested changes locally
git add updated-file.js
git commit -m "Address review: use consistent variable naming"
git push
The new commits automatically appear in the open PR.
While your PR is open, main may receive other merges. Keep your branch current to avoid conflicts:
git switch main
git pull origin main
git switch feature/user-profile
git merge main
git push
GitHub offers three merge strategies:
Teams typically configure branch protection rules on GitHub to enforce that:
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.