## Why The existing git.md was thin — missing atomicity, working-state, and trailer guidance that belong in any professional git workflow. No commit message template existed, making the expected format implicit and inconsistent across sessions. ## Impact - git.md is now the canonical reference for commit hygiene rules - commits.md provides a structured template (Why / Implementation Notes / Impact / Git Trailers) that agents and humans can follow - AGENTS.md cross-references commits.md so it is discoverable at session start Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
17 lines
1.3 KiB
Markdown
17 lines
1.3 KiB
Markdown
# Git conventions
|
|
|
|
- Never skip hooks with `--no-verify`. Hooks are the automated QA gate; bypassing them breaks the pipeline.
|
|
- Never force-push `main` or `master`.
|
|
- Keep commits atomic. Each commit should represent one logical, independently reviewable and reversible change.
|
|
- Ensure every commit leaves the repository in a working state (buildable/testable where practical).
|
|
- Commit messages explain **why**, not **what**. The diff already documents what changed.
|
|
- Never commit secrets, credentials, or environment-specific config.
|
|
- Use Conventional Commits (`feat:`, `fix:`, `docs:`, `chore:`, `refactor:`, `test:`, etc.).
|
|
- Reference related issues, ADRs or design documents using Git trailers when applicable.
|
|
|
|
## Submodules
|
|
|
|
- When working with submodules: commit and push the submodule first, then update and push the parent repo. Pushing the parent while the submodule commit doesn't exist on the remote breaks `git submodule update` for anyone who pulls.
|
|
- Always use `rtk git` for parent repo operations; drop into the submodule directory for submodule-specific git commands.
|
|
- After adding a submodule, check `git status` in both the parent and the submodule — a `-dirty` flag means the submodule has uncommitted local changes that need to be committed before the parent pointer is updated.
|