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
git checkout -b add-login-feature
Work on a branch so main stays stable while you iterate.
2) Commit your changes
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
git push -u origin add-login-feature
Now GitHub can create a PR comparing add-login-feature → main.
4) Open the pull request
In GitHub: Pull requests → New 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.
Merge commit — keeps full branch history Squash & merge — combines PR commits into one Rebase & merge — linear history, replays commits