Lesson
Pull requests
The full lifecycle from issue to merged, reviewed change on a protected main.
Learning objectives
- Walk the full PR lifecycle
- Understand review and checks
- Choose a merge strategy
Branch and push
Start from an up-to-date main, create a focused feature branch, make small commits, and push the branch to open a pull request.
Review and checks
Automated checks run on the branch. Reviewers comment, you push follow-up commits to address feedback, and the PR is approved when it meets the bar.
Merge and clean up
Choose a merge strategy (often squash for small features), merge into main, delete the branch, and pull the updated main locally.
Try it yourself
Empty folder
Run git init to create a repository.
Working directory
Clean — no uncommitted changes.
Staging area
Nothing staged. Run git add.
Repository
No commits yet.
The commands that begin a pull-request workflow.
Commands used
git switch main
git pull origin main
git switch -c feat/graph-zoom
git push -u origin feat/graph-zoomCommon mistakes
- • Opening huge, unreviewable PRs.
- • Merging failing checks.
Best practices
- • Keep PRs small and focused.
- • Write a clear description and link the issue.
Mini challenge
List the steps from creating a branch to a merged, reviewed change on main.
Open the visualizer to try itSummary
- PRs add review and checks before merge.
- Keep them small.
- Delete branches and sync main after merge.