Overview
This hub fixes the branch model for a small team or solo author shipping to main, then points to the page that owns each topic. Branches are short-lived, main is protected and deploys, and every change lands through a pull request.
Treat main as the deploy branch
Never push directly to main; land work through a pull request. Enforce that with a ruleset, not with habit: github-branch-protection has the rules. Tag releases from main when the project ships versions (github-releases); otherwise the latest commit on main is the release.
Use short-lived feature branches
One branch per task, deleted after merge.
- Prefix by intent:
feat/<name>,fix/<name>, andclaude/<name>for branches that start in a Claude Code session, so provenance is visible in review. - Rebase onto
mainbefore opening the PR; do not mergemainback into the feature branch. - Split a branch that outlives a week; long-lived branches produce painful merges.
Set repository defaults once
Under Settings, General, Pull Requests:
- Allow squash merging only; turn off merge commits and rebase merging.
- Turn on “Automatically delete head branches.”
- Turn on “Allow auto-merge” (see github-pr-workflow).
Under Settings, Actions, set the default GITHUB_TOKEN permission to read-only and request more per workflow (github-actions). Turn on secret scanning and push protection (github-secrets).
Know which page owns what
| Topic | Page |
|---|---|
| PR titles, squash, drafts, CODEOWNERS, review | github-pr-workflow |
| Rulesets and branch protection | github-branch-protection |
| Workflow YAML, caching, permissions, action versions | github-actions |
| Secrets, OIDC, scanning | github-secrets |
| Tags, semver, release notes | github-releases |
The gh CLI | github-cli |