Internal Explainer

Pull Requests on GitHub

A pull request (PR) is a structured way to propose changes from one branch to another, get review, run checks, and merge safely into main.

What a PR does

Base ⇄ Compare • Review • Checks • Merge

BLUF: A PR is a request to merge your branch's commits into another branch (usually main), with review + automated checks before merging.

Base branch

The destination branch (often main). This is what you want to update.

Compare branch

Your feature/fix branch containing commits you want merged into the base branch.

1) Create a branch
Terminal
git checkout -b add-login-feature
Work on a branch so main stays stable while you iterate.
2) Commit your changes
Terminal
git add .
git commit -m "Add login page UI"
Commits are the atomic units the PR will propose for merging.
3) Push the branch to GitHub
Terminal
git push -u origin add-login-feature
Now GitHub can create a PR comparing add-login-featuremain.
4) Open the pull request
In GitHub: Pull requestsNew pull request → choose base + compare branches.
Compare view
GitHub shows files changed, additions/deletions, and a review thread.
base: main • compare: add-login-feature
5) Review + automated checks
Reviewers comment on lines, request changes, and approve. CI may run tests + linting.
✓ tests passed ✓ lint passed ⏳ build running

Many teams require "green" checks + at least one approval before merging.

6) Merge the PR
When approved and checks pass, you merge into main.
Common merge strategies
Merge commit     — keeps full branch history
Squash & merge    — combines PR commits into one
Rebase & merge    — linear history, replays commits
Copied.