Skip to content

Lesson

Pull requests

The full lifecycle from issue to merged, reviewed change on a protected main.

Intermediate 8 min read

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

interactive visualization

Empty folder

Run git init to create a repository.

Working directory

Clean — no uncommitted changes.

git add ↓

Staging area

Nothing staged. Run git add.

git commit ↓

Repository

No commits yet.

1/5Empty repositoryOpen in visualizer

The commands that begin a pull-request workflow.

Commands used

terminal
git switch main
git pull origin main
git switch -c feat/graph-zoom
git push -u origin feat/graph-zoom

Common 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 it

Summary

  • PRs add review and checks before merge.
  • Keep them small.
  • Delete branches and sync main after merge.
Next lessonWorkflows