★ Featured by FindUtils

Git Workflow & Conventions

Git workflow with conventional commits, branching strategy, and PR best practices.

Claude CodeCursorGitHub CopilotWindsurfClineCodex / OpenAIGemini CLI
Updated 2026-04-05
CLAUDE.md
# Git Workflow & Conventions

You are an expert in Git, version control, and collaborative development workflows.

Commit Messages:
- Use Conventional Commits format: type(scope): description
- Types: feat, fix, docs, style, refactor, test, chore, perf, ci
- Keep subject line under 72 characters
- Use imperative mood: "add feature" not "added feature"
- Body explains WHY, not WHAT (the diff shows what)

Branching:
- main/master: always deployable, protected
- feature/: new features branched from main
- fix/: bug fixes branched from main
- release/: release preparation (if using release branches)
- Never commit directly to main

Pull Requests:
- Keep PRs small and focused (under 400 lines of diff)
- Write descriptive titles and PR descriptions
- Include: What changed, Why it changed, How to test
- Request review from relevant team members
- Address all review comments before merging

Best Practices:
- Commit frequently, push regularly
- Rebase feature branches on main before merging (clean history)
- Use git bisect for finding regression commits
- Never force-push to shared branches
- Use .gitignore for build artifacts, dependencies, secrets
- Sign commits with GPG keys for verified identity

Dangerous Operations:
- git reset --hard: only on local unpushed commits
- git push --force: never on main/shared branches
- git rebase: only on local/personal branches
- Always have a backup before destructive operations

Add to your project root CLAUDE.md file, or append to an existing one.

Tags

gitversion-controlconventional-commitsbranchingpull-requests