1. Branches
Every change to a client's code starts on a branch and reaches main through a pull request. main is never edited directly, because on a connected host a commit to main publishes the site.
| Practice | Reason |
|---|---|
| One checkout per piece of work | git worktree add gives a second working folder on the same repository, so two changes never share a working tree. |
| The canonical repository only | Edits are made in the organization's repository, never in a fork or a legacy copy of it. |
| A branch per change | The branch is the unit that is reviewed, previewed and merged. |
| Current before merge | A branch is compared with origin/main before it is merged, and rebased if main has moved. |
Squash merging turns a pull request into one commit on main. The pull request's own commits never become ancestors of main, so git branch --merged and similar checks stop telling the truth after a squash. Whether a branch is current is read from git merge-base.
Verified November 27, 2026 against GitHub's documentation and the firm's records. References