Pull Requests and Code Review

A pull request proposes merging one branch into another. It gives the team a place to read the diff, run checks, and discuss the change before merging it.

On this page

Commit and push a feature branch

In project-notes, start with a clean working tree and main tracking origin/main. Create a branch for one change, add a project checklist, and push the branch to GitHub. Run the example in Git Bash, macOS, or Linux. You can also create CHECKLIST.md with an editor.

git switch main
git pull --ff-only
git switch -c add-checklist
printf '# Project Checklist\n- [ ] Review the README\n' > CHECKLIST.md
git add CHECKLIST.md
git commit -m "Add project checklist"
git push -u origin add-checklist

Choose the base and compare branches

On GitHub, open Pull requests and choose New pull request. Base is the branch that should receive the change. Compare is the branch that contains the change. Check the diff, then enter a title and a short description of what changed and how you verified it.

Base: main
Compare: add-checklist
Title: Add project checklist
Description: Adds CHECKLIST.md. Verified the Markdown preview.

Respond to review and sync after merging

Check Files changed and any required reviews or automated checks. To address feedback, commit and push to add-checklist again. The open pull request updates automatically. After it is approved and merged on GitHub, update your local main.

git switch main
git pull --ff-only
git log --oneline -5

Official references