Git Workflow Standards
Overview
Git workflow conventions for consistent version control practices. Covers branch naming, commit messages, PR creation, and code review standards.
Branch Naming Convention
Format: <type>/<short-description>
| Type | Usage | Example |
|---|---|---|
feature/ | New feature | feature/add-dark-mode |
fix/ | Bug fix | fix/login-redirect-loop |
chore/ | Maintenance | chore/update-dependencies |
hotfix/ | Urgent production fix | hotfix/payment-crash |
refactor/ | Code restructure | refactor/auth-module |
docs/ | Documentation | docs/api-endpoints |
Rules:
- •Lowercase, kebab-case
- •Short but descriptive (3-5 words max)
- •No issue numbers in branch name
Commit Message Format (Conventional Commits)
code
<type>(<scope>): <description> [optional body] [optional footer]
Types
| Type | When to Use |
|---|---|
feat | New feature for the user |
fix | Bug fix |
chore | Maintenance (deps, config, scripts) |
docs | Documentation changes |
style | Formatting, no logic change |
refactor | Code restructure, no behavior change |
test | Adding/fixing tests |
perf | Performance improvement |
ci | CI/CD configuration |
Rules
- •Header: max 50 characters, imperative mood ("add" not "added")
- •Scope: module or component name (auth, dashboard, api)
- •Body: explain WHAT and WHY, not HOW
- •Footer: reference issues (Closes #123), breaking changes
- •Language: English
Examples
code
feat(auth): add Google OAuth login Implement Google OAuth using Supabase auth provider. Users can now sign in with their Google account. Closes #42
code
fix(dashboard): resolve chart rendering on mobile Charts were overflowing on screens < 768px due to fixed width container. Switched to responsive container.
code
chore(deps): update Next.js to v15.1 BREAKING CHANGE: params is now async in route handlers. Updated all dynamic routes to await params.
Pull Request Standards
Title
- •Max 70 characters
- •Follows same convention as commits:
type(scope): description - •No period at end
Body Template
markdown
## Summary - Brief description of changes (2-3 bullet points) ## Changes - Specific files/modules changed and why ## Test Plan - [ ] Manual testing steps - [ ] Unit tests pass - [ ] Build succeeds - [ ] Lint passes
PR Checklist (Before Requesting Review)
- •
pnpm lintpasses - •
pnpm buildsucceeds - •No console.log left
- •No
anytypes - •No hardcoded secrets
- •Self-reviewed the diff
- •Updated docs if needed
Pre-Commit Verification
Before every commit, verify:
- •No .env files staged
- •No console.log statements
- •No commented-out code blocks
- •No
anytypes - •TypeScript compiles without errors
- •All imports are used
Workflow
code
1. Create branch from main git checkout -b feature/my-feature 2. Make changes and commit (small, atomic commits) git add specific-files git commit -m "feat(scope): description" 3. Push and create PR git push -u origin feature/my-feature gh pr create 4. After review approval Squash and merge via GitHub UI Delete branch after merge