# Git & Release Standards
## 1. Branching Model (Trunk-Based)
- **`main` is the single long-lived branch** and must always stay green (CI passing).
- All changes happen on **short-lived branches** created from `origin/main`, merged via **squash merge** after CI passes, and deleted immediately after merge.
## 2. Creating & Naming Branches
```bash
git fetch origin
git checkout -b <type>/<short-kebab-description> origin/main
```
- Format: `<type>/<short-kebab-description>` — lowercase ASCII, digits, and hyphens (`-`) only; use full descriptive words.
- Allowed prefixes: `feat/`, `fix/`, `docs/`, `refactor/`, `test/`, `ci/`, `chore/`.
## 3. Commit Messages
Use **Conventional Commits** (`<type>(<scope>): <imperative summary>`), e.g.:
- `feat(xray): add atomic outbound switcher`
- `fix(probe): classify HTTP 429 as geo-blocked`
- `docs(git): document release checklist`
## 4. Tagging & Releases (SemVer)
`proxy-pilot` uses Semantic Versioning (`vMAJOR.MINOR.PATCH`, pre-releases `v0.1.0-rc.1`):
1. Ensure `main` is green (`fmt`, `clippy`, `test`).
2. Bump `version` in `Cargo.toml` and update `CHANGELOG.md` on `main`.
3. Create and push an **annotated** tag (only when explicitly authorized by the owner):
```bash
git tag -a v0.1.0 -m "Release v0.1.0"
git push origin v0.1.0
```
4. Pushing `v*` triggers `.github/workflows/release.yml` to build and publish static Linux `musl` binaries (`amd64`, `arm64`) with `.sha256` checksums.
5. **Immutable Tags:** Never move, delete, or re-create a pushed `v*` tag.
## 5. Git Authorization
- Never run `git commit`, `git push`, `git merge`, `git tag`, or open a PR without explicit owner authorization for that specific action.
- Preserve unrelated staged, unstaged, and untracked files; commit only in-scope files.