Git Workflow
Branch Strategy
- •Use GitHub Flow
- •Main branch is always deployable
- •Create feature branches from main
- •Use descriptive branch names:
feature/add-auth,fix/login-bug
Conventional Commits
Use the following prefixes:
| Prefix | Description |
|---|---|
feat: | New feature |
fix: | Bug fix |
docs: | Documentation only |
style: | Formatting, no code change |
refactor: | Code change without feature/fix |
test: | Adding or updating tests |
chore: | Maintenance, dependencies |
Examples:
code
feat: add user authentication endpoint fix: resolve login timeout issue docs: update API documentation refactor: extract validation logic to utility test: add unit tests for auth service chore: update dependencies
Commit Best Practices
- •Write clear, concise messages
- •Focus on "why" not "what"
- •Keep commits atomic (one logical change)
- •Run tests before committing
- •Never commit secrets or credentials
Pre-Commit Checklist
- •Run tests:
pytest - •Format code:
ruff format . - •Lint code:
ruff check . - •Review changes:
git diff
Pull Requests
- •Create descriptive PR titles
- •Include summary of changes
- •Reference related issues
- •Request reviews from relevant team members
Files to Never Commit
- •
.envfiles with secrets - •
credentials.json - •API keys or tokens
- •Large binary files
- •IDE-specific files (unless shared team config)