Github Branching Strategy - binarybarnyard/project-btc GitHub Wiki
This document outlines the branching strategy for our development team, focusing on Epic, Story, Task, and Defect branch types. Each branch type serves a specific purpose and follows a clear workflow to ensure code quality and efficient collaboration.
-
Epic Branches
-
Naming Convention:
epic/<epic-name>
- Purpose: To organize large features or projects that consist of multiple stories or tasks.
- Usage: Create an Epic branch for large, overarching features.
-
Naming Convention:
-
Story Branches
-
Naming Convention:
story/<epic-name>/<story-name>
- Purpose: To implement individual features or user stories within an Epic.
- Usage: Create a Story branch under its parent Epic branch.
-
Naming Convention:
-
Task Branches
-
Naming Convention:
task/<story-name>/<task-name>
- Purpose: To work on smaller, manageable units of work within a Story.
- Usage: Create a Task branch under its parent Story branch.
-
Naming Convention:
-
Defect Branches
-
Naming Convention:
defect/<epic-or-story-name>/<defect-name>
- Purpose: To fix bugs or defects identified in either Epic or Story branches.
- Usage: Create a Defect branch under the relevant Epic or Story branch.
-
Naming Convention:
-
Epic:
git checkout main && git pull origin main && git checkout -b epic/<epic-name>
-
Story:
git checkout epic/<epic-name> && git pull origin epic/<epic-name> && git checkout -b story/<epic-name>/<story-name>
-
Task:
git checkout story/<epic-name>/<story-name> && git pull origin story/<epic-name>/<story-name> && git checkout -b task/<story-name>/<task-name>
-
Defect:
git checkout <epic-or-story-branch> && git pull origin <epic-or-story-branch> && git checkout -b defect/<epic-or-story-name>/<defect-name>
- Make commits regularly with clear and descriptive messages.
- Ensure each commit is focused on a single task or fix.
- Commit messages should be 280 characters or less (Get descriptive in the PR description)
- After the first commit create a draft PR
- After the first commit create a draft PR
- Push the branch to the remote repository:
git push origin <branch-name>
- Open a Pull Request (PR) from the branch to its parent branch (Epic -> Debug, Story -> Epic, or Task -> Story).
- Include a detailed description of changes and link to relevant issues or tasks.
- Conduct code reviews for every PR.
- Once approved, merge the branch into its parent branch.
- Delete the branch after merging to keep the repository clean.