Git Commit Convention

J·2025년 6월 25일

Summary

  • First line: 50 characters max
  • Body lines: 72 characters max
  • Use present tense, imperative mood
  • Separate subject, body, and footer with blank lines

Basic Structure

<type>(<scope>): <subject>

<body>

<footer>

Step 1: Choose the Type

feat: A new feature
fix: A bug fix
docs: Documentation only changes
style: Changes that don't affect code meaning (whitespace, formatting)
refactor: Code changes that neither fix bugs nor add features
perf: Performance improvements
test: Adding missing tests or correcting existing tests
chore: Changes to build process or auxiliary tools

Step 2: Add Optional Scope

The scope specifies what part of the codebase is affected:
feat(auth): add login validation
fix(database): resolve connection timeout
docs(readme): update installation instructions

Step 3: Write the Subject Line

Use imperative mood ("add" not "added" or "adds")
Keep it under 50 characters
Don't capitalize the first letter
No period at the end

Step 4: Add Body (Optional)

Separate from subject with blank line
Explain what and why, not how
Wrap at 72 characters
Use imperative mood

Reference issues: "Closes #123"
Breaking changes: "BREAKING CHANGE: API endpoint changed"

Examples
bashfeat: add user authentication system

fix(parser): handle edge case with empty input

docs: update API documentation for v2.0

BREAKING CHANGE: remove deprecated login endpoint
Quick Rules

0개의 댓글