Aller au contenu principal

Rules: git

[optional body - details on the "what" and "why"]

Affected files

These rules apply to files matching the following patterns:

All files

Detailed rules

Git Rules

Conventional Commits

type(scope): short description (< 50 characters)

[optional body - details on the "what" and "why"]

[optional footer - issue references, breaking changes]

Allowed types

TypeUsage
featNew feature
fixBug fix
refactorRefactoring without functional change
testAdding or modifying tests
docsDocumentation
styleFormatting (no code change)
choreMaintenance, dependencies
perfPerformance improvement

Branch Naming

TypePatternExample
Productionmainmain
Developmentdevelopdevelop
Featurefeature/xxxfeature/user-auth
Bugfixfix/xxxfix/login-error
Refactoringrefactor/xxxrefactor/api-client

Safety Rules

  • IMPORTANT: Never push --force on main
  • IMPORTANT: Never commit secrets (.env, credentials)
  • Check git diff before every commit
  • Use branches for any change

Workflow

  • Rebase preferred over merge for feature branches
  • Squash commits before merge if history is noisy
  • Pull with rebase (git pull --rebase)
  • Atomic commits (1 commit = 1 logical change)

Best Practices

  • Clear and descriptive commit messages
  • Explain the WHY, not the HOW
  • Reference issues if applicable
  • Do not commit generated files (build, dist)

Automatic application

These rules are automatically applied by Claude during:

  • Reading the matching files
  • Modifying code
  • Suggestions and fixes

See also