Branch Structure
Current Structure
-
Main Branch:
main: Your primary branch that should always be stable and ready for production.
-
Unit of Work (UOW) Release Branches:
- Naming:
uow-name/release - Example:
allstar-teambuilding/releaseordirector-dashboard/release - Usage: Indicates a release branch for a specific UOW. This branch is merged into
mainafter all tickets under that UOW are complete.
- Naming:
-
Feature/Issue Branches:
- Naming:
#github_issue_number-small-descriptive-text - Example:
#1234-fix-user-login - Usage: Created for individual tickets/issues. Merged into the corresponding
uow-namebranch when complete.
- Naming:
Best Practices & Suggestions
1. Branch Naming Conventions
- Use lowercase with hyphens for consistency across all branch types.
- Ensure release branches follow the
/releasesuffix convention:- Example:
allstar-teambuilding/releaseordirector-dashboard/release.
- Example:
2. Pull Request (PR) Best Practices
- Feature to UOW: Open PRs from feature branches to the corresponding
uow-namebranch.- PR Title:
[#1234] Add new feature - Use the GitHub issue number in the PR title for easy tracking.
- PR Title:
- UOW to Main: Once all tickets are merged into the
uow-namebranch:- Open a PR from
uow-name/release=>mainbranch. - PR Title:
UOW: Allstar Teambuilding
- Open a PR from
3. Branch Protection Rules
- Protect the
mainbranch to prevent direct pushes, enforcing code reviews via PRs. - Optionally, protect
uow-nameanduow-name/releasebranches to ensure peer review before merging.
4. Commit Messages
- Follow a consistent commit message format:
- Example:
[#1234] Fix user login flow - Format:
[Issue Number] Short description of the change
- Example:
5. Tags and Releases
- Use Git tags for marking releases on the
mainbranch.- Use semantic versioning (e.g.,
v1.0.0) for releases that are merged ontomainon GitHub.
- Use semantic versioning (e.g.,
Example Workflow
-
Create Feature Branch:
git checkout -b "#1234-add-new-feature" -
Develop and Commit Changes:
git commit -m "[#1234] Implemented user authentication flow" -
Push Feature Branch & Open PR to UOW Branch:
git push origin "#1234-add-new-feature" -
Merge Feature Branch into UOW Branch (via PR review).
-
Merge UOW Branch to Release:
git checkout -b "allstar-teambuilding/release" -
Merge Release Branch into Main (once all UOW tickets are complete).
Benefits of This Structure
- Scalability: The UOW-based grouping helps manage related features and tickets, making it easier to organize and release code in cohesive chunks.
- Clarity: Clear branch naming conventions improve team collaboration and communication.
- Flexibility: Supports parallel development on different UOWs, reducing bottlenecks.