Skip to content

Git Branching Strategy and Best Practices

Mai edited this page Feb 25, 2025 · 1 revision

Branch Structure

To maintain a clean and efficient development workflow, we follow a structured branching strategy in Git.

Main

This is the production branch, where all stable and released code resides. Only thoroughly tested and approved code is merged here.

Develop

This branch is created from main and serves as the primary development branch, where ongoing feature development and bug fixes take place.

Feature Branches

Feature branches are created off of develop to work on specific GitHub issues, such as new features or bug fixes. Once completed, they are merged back into develop.

Pull Requests

  • Feature branches are merged into develop via a Pull Request (PR) after code review.
  • Once all features for a release are complete, develop is merged into main via a PR to ensure only stable code reaches production.

GitHub Releases

  • When merging develop into main, a GitHub release should be created, providing a summary of changes, features, and fixes introduced in that version.

Best Practices for Naming Branches

Branch names should be descriptive and related to the associated GitHub issue. A recommended format is:

  • Feature branches: {issue-number}-{short-description}
    • Example: 42-add-login-auth

Clone this wiki locally