Script Valley
Git and GitHub Complete Course: From Beginner to Advanced
Working with GitHub: Remotes, Push, Pull, and CollaborationLesson 3.4

Pull Requests and Code Review

pull request, PR, code review, review comments, draft PR, PR template, request changes, approve PR

Pull Requests and Code Review

A pull request (PR) is a GitHub feature that formally proposes merging one branch into another. It provides a space for discussion, review, and approval before code reaches the main branch. Pull requests are the cornerstone of team collaboration on GitHub.

Creating a Pull Request

Push your feature branch to GitHub, then navigate to the repository. GitHub typically shows a banner prompting you to create a PR. Click it, fill in a title and description, assign reviewers, add labels, and submit. A good PR description explains what the change does, why it is needed, and how it was tested.

Reviewing a Pull Request

Reviewers can comment on specific lines by clicking the plus button that appears when hovering over code lines. They can suggest exact changes with suggestion blocks that the author can accept with one click. When review is complete, reviewers choose: Approve, Comment, or Request Changes.

Draft Pull Requests

Mark a PR as a draft to signal it is not ready for review but you want early feedback or want to trigger CI checks. Convert it to a ready-for-review PR when complete.

PR Templates

Create a file at .github/PULL_REQUEST_TEMPLATE.md to provide a consistent checklist for every PR in your repository. Include sections for description, testing steps, and checklist items.

Merging Options

GitHub offers three merge strategies: Create a merge commit (preserves all commits), Squash and merge (combines all commits into one), and Rebase and merge (replays commits linearly). Choose based on your team's history preferences.

Up next

Issues, Projects, and GitHub Collaboration Features

Sign in to track progress

Pull Requests and Code Review โ€” Working with GitHub: Remotes, Push, Pull, and Collaboration โ€” Git and GitHub Complete Course: From Beginner to Advanced โ€” Script Valley โ€” Script Valley