Skip to content
Guest
Learn Git · Course Syllabus Show lessons
Collaboration & GitHub · 7 min read · Beginner

Pull Requests & Code Review

Ship production code with feature branches, focused Pull Requests, squash merges, and constructive code reviews.

What you'll learn

  • Follow the standard GitHub Flow from branch to Pull Request
  • Write clear PR descriptions with context, screenshots, and test notes
  • Choose between merge commit, squash-and-merge, and rebase

In professional engineering teams, developers rarely push directly to main. Instead, changes go through a Pull Request (PR) so automated CI checks and teammates can review the diff first.

The GitHub Flow

  1. Pull the latest main.
  2. Create a short-lived feature branch (git checkout -b fix/navbar-gap).
  3. Make small, tested commits and push your branch.
  4. Open a Pull Request describing what changed, why, and how you tested it.
  5. Address review feedback, pass CI checks, and merge (often via Squash and Merge to keep main history tidy).

Fill-in-the-Blank Exercise

Reviewing Changes Before Opening a PR

Create a fix branch and inspect your commit summary before opening a Pull Request.

git checkout -b fix/button-icon
git  --oneline

Try It Yourself (Interactive Git Terminal)

GitFeature Branch for Pull Request
main
(main) $ git status
On branch main
Untracked files: index.html, styles.css

Check Your Understanding

Score: 0 / 1

1. Why do many teams use Squash and Merge on GitHub Pull Requests?

Study Workspace

Finished this lesson?

Your progress is saved locally in your browser, no account needed.

Search courses, lessons, and references

Type to search across all courses, lessons, and quick references.

Press Esc to close Powered by Pagefind