Git Workflow
Branch Strategy
main— production-ready, merges only fromdevelopvia PRdevelop— integration branch, feature branches merge herefeature/*— one branch per task/featurefix/*— one branch per bug fix- Never commit directly to
mainordevelop
Commit Rules
- Atomic commits: one logical change per commit. Don't mix refactoring with features
- Conventional Commits:
type(scope): descriptionfeat: new featurefix: bug fixrefactor: code change without behavior changetest: adding/updating testsdocs: documentationchore: config, deps, tooling
- Subject line: ≤50 chars, imperative mood ("add" not "added")
- Body: explain the why, not the what
Git Commands
# Interactive rebase to clean up commits before PR
git rebase -i HEAD~N
# Fix up a commit (combine with parent, keep parent message)
git commit --fixup <sha> && git rebase -i --autosquash
# Bisect to find where a bug was introduced
git bisect start && git bisect bad && git bisect good <known-good>