versioncontrol
Gittips

Commit Messages

  • feat, for addition or removal of a feature.
  • fix, for squashing bugs
  • chore, for installing npm packages
  • test, for adding test suites
  • refactor, for refactoring code flow but not changing the feature itself
  • style, for styling code structure like spacing, reorder or remove unused imports, etc.

The naming convention for Git branches can vary depending on the team, project, or company, but there are some common practices that are widely used in the industry. These conventions help in organizing branches in a way that makes it clear what they contain, their purpose, and sometimes even their associated ticket or issue number. Here are some of the commonly used branch naming conventions:

  1. Feature Branches: These branches are used for developing new features.

    • Format: feature/<feature-name>
    • Example: feature/add-mdx-support
  2. Bugfix Branches: These are for fixing bugs.

    • Format: bugfix/<bug-name> or fix/<bug-name>
    • Example: bugfix/fix-header-alignment
  3. Hotfix Branches: Used for making quick fixes in production.

    • Format: hotfix/<issue>
    • Example: hotfix/critical-login-bug
  4. Release Branches: For preparing a new release.

    • Format: release/<version-number>
    • Example: release/1.0.3
  5. Refactor Branches: When the primary goal is to refactor code.

    • Format: refactor/<description>
    • Example: refactor/cleanup-routing-logic
  6. Documentation Branches: For updating or adding documentation.

    • Format: docs/<description>
    • Example: docs/update-readme
  7. Test Branches: For adding or modifying tests.

    • Format: test/<description>
    • Example: test/add-e2e-tests
  8. Experimental or Spike Branches: For experiments or exploratory work.

    • Format: experiment/<description> or spike/<description>
    • Example: experiment/new-ui-framework
  9. Personal or Developer Branches: Sometimes used by developers for their work, especially in large teams.

    • Format: <username>/<description>
    • Example: john/add-animation-effects
  10. Issue or Task Branches: When branches are associated with specific issues or tasks (often in conjunction with issue tracking systems).

    • Format: issue-<issue-number>-<short-description>
    • Example: issue-123-update-user-model

Remember, these are general guidelines and can vary. The most important aspect is that the branch naming is consistent and understandable within your team or project. It's also good practice to keep branch names short yet descriptive, and use hyphens or underscores to separate words for readability.