CPCODELAB
Git & GitHub

GitHub and the Pull Request Flow

11 min read

What Is a Pull Request?

A pull request (PR) is a GitHub feature that formally proposes merging one branch into another. It is the standard mechanism for code review in professional teams. PRs are not a Git concept — they live on GitHub's platform.

The CPCODELAB PR Workflow

  1. Create a feature branch: git switch -c feature/user-auth.
  2. Make commits. Push regularly: git push -u origin feature/user-auth.
  3. Rebase on latest main before opening the PR.
  4. Open a PR on GitHub: base main, compare feature/user-auth.
  5. Fill in the PR template: what changed, why, how to test, screenshots if UI.
  6. Assign a senior reviewer. Address review comments with new commits.
  7. Once approved and CI passes, a senior merges using "Squash and merge".
  8. Delete the remote branch after merge.

Writing a Good PR Description

  • What: one-sentence summary of the change.
  • Why: the motivation or issue it addresses.
  • How to test: exact steps a reviewer can follow to verify the change.
  • Screenshots: required for any UI change.

Reviewing Pull Requests

As a reviewer, use GitHub's inline comment feature to leave feedback on specific lines. Prefer suggestions (ctrl+shift+R in the GitHub web editor) — the author can apply them with a single click. When your review is complete, submit it as Approve, Request Changes, or Comment.

PR reviews are a learning opportunity, not a judgement. When you receive "Request Changes", read the comments carefully, ask questions in the PR thread if unclear, push fixes as new commits, and re-request review.

Ready to test yourself?
Practice Git & GitHub— quiz & coding exercises