The Loop: Branch, Commit, PR, Merge
Code doesn't go from your laptop to production. It goes through a loop every company runs. Learn it once and every team feels familiar.
The loop, start to finish
- Update main, then branch off it — named for the work, not for you.
- Small commits as you go. Each one a step that makes sense on its own.
- Push and open a PR. The description says what changed and why.
- Review happens. Comments, maybe "changes requested". You respond and re-push.
- Approval → merge (often squashed into one commit) → the branch is deleted.
▸ The whole loop in commands
git checkout main && git pull
git checkout -b test/checkout-smoke
# ...work...
git add -p # stage in reviewable pieces
git commit -m "Add smoke tests for guest checkout"
git push -u origin test/checkout-smoke
# then open the PR in the browserWho approves, and what blocks
On a real repo the merge button is locked until the rules pass: one or two approvals, and CI green. Nobody merges by permission of politeness — the branch protection does the enforcing. That's why a red pipeline on your PR is everyone's business.
Grounded in the git documentation and GitHub's pull request flow