Skip to content

Instantly share code, notes, and snippets.

@npapratovic
Last active September 14, 2022 13:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save npapratovic/8b2dcd91bb31b90516f2a4b0e55e5b82 to your computer and use it in GitHub Desktop.
Save npapratovic/8b2dcd91bb31b90516f2a4b0e55e5b82 to your computer and use it in GitHub Desktop.

Commit Message Convention:

Template:

Commit title: type + subject

Commit body

Commit footer

1) Commit type (mandatory)

  • Add - new feature added to application
  • Fix - a bug fix
  • Style - updates related to styleing
  • Refactor - used when refactoring specific codebase section
  • Test - used when debugging / testing issue / feature

2) Commit subject (mandatory)

  • short description (50 chars) in imperative of applied changes
  • without periods, punctiations or whitespace errors

3) Commit body (optional)

  • separated from title with blank line
  • each line limited to 72 characters
  • try to explain original problem and changes what and why vs. how

4) Commit footer (optional)

  • use this to reference issues in project managment software e.g. JIRA

Best practices:

  • Make Small, Single-Purpose Commits
  • Commit Early & Often
  • make sure to agree on a common workflow that everyone follows (long-running branches, feature branches, merge or rebase, git-flow)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment