Skip to content

Git Flow

This document outlines the Git branching strategy for Coldtivate.

Main Branches

The following branches are permanent and protected:

  • main: Contains production-ready code. Only merges from development are allowed.
  • development: Integration branch for ongoing development. All feature and fix branches are merged here.

Supporting Branches

Branch Type Prefix Base Branch Merge Target Naming Convention
Feature feat/ development development feat/ABC-123-feature-name
Bug Fix fix/ development development fix/ABC-123-bug-description

Workflow

Creating a New Feature or Bug Fix Branch

  1. Ensure your local development branch is up to date:
    git checkout development
    git pull origin development
    
  2. Create a new branch:
    git checkout -b feat/feature-name
    
    or for bug fixes:
    git checkout -b fix/bug-description
    
  3. Implement changes and commit them with meaningful messages.
  4. Push your branch:
    git push origin feat/feature-name
    

Merging Changes

  • Once development on a branch is complete, create a pull request (PR) to merge into development.
  • After review and approval, the branch can be merged.
  • Delete the branch after merging to keep the repository clean.

Releasing to Production

  1. Ensure development is stable and up to date:
    git checkout development
    git pull origin development
    
  2. Switch to main and ensure it's up to date:
    git checkout main
    git pull origin main
    
  3. Merge development and push to remote:
    git merge development
    git push origin main
    
  4. Tag the release:
    yarn version --new-version (major | minor | patch)
    git push --tags
    

Best Practices

  • Keep branch names descriptive and concise.
  • Write meaningful commit messages.
  • Regularly update your branch with development to avoid merge conflicts.
  • Always create a PR for merging into development.

By following this strategy, we maintain a clean, organized, and efficient Git workflow.