Give the branch one job
Good branch scopes include:- Add an authentication quickstart
- Correct the webhook examples
- Reorganize the API navigation
Name it for the outcome
Use a short, specific name with lowercase letters and hyphens:add-auth-quickstartfix-webhook-examplesreorganize-api-navigation
updates, ethan-edits, and docs-fixes don’t tell a teammate what is in the branch. Two to five meaningful words is often enough, but clarity matters more than a fixed length.
Follow an existing team convention if the repository uses issue numbers or prefixes such as docs/.
Start from the current deployment branch
Before creating a local branch, update the branch your site deploys from. This example usesmain:
Keep the branch understandable
Commit coherent checkpoints and push the branch when you want to share or back up the work. If the branch’s purpose grows from “fix one example” into “rewrite the entire API section,” stop and decide whether the new work deserves another branch. Long-running work isn’t automatically wrong. A migration or product launch may take time. Keep it manageable by merging independent groundwork separately and syncing the remaining branch with the deployment branch when needed.Merge and clean up
Before merging, confirm that:- The pull request still matches the branch’s stated purpose
- The preview renders the intended pages and navigation
- Required reviews and configured checks have passed
- No unrelated files slipped into the diff