This document outlines the Git branching strategy and workflow conventions used in the SparX Wallet Flutter project.
The project follows a modified GitFlow model with the following branch types:
-
main- Production code that has been released to users- Always in a deployable state
- Protected from direct pushes
- Changes come only through release branches via pull requests
-
dev- Integration branch for ongoing development- Features and fixes are merged here
- Represents the current state of development
- Should always be in a buildable state
-
feature/- Feature development branches- Created from
dev - Merged back to
devwhen feature is complete - Naming:
feature/EWM-XXX_feature-name(e.g.,feature/EWM-511_typesafe_navigation)
- Created from
-
fix/- Bug fix branches- Created from
dev - Merged back to
devwhen fix is complete - Naming:
fix/EWM-XXX_bug-description(e.g.,fix/EWM-507)
- Created from
-
refactor/- Code refactoring branches- For code improvements without changing functionality
- Naming:
refactor/EWM-XXX_component-name(e.g.,refactor/EWM-502_separated-column)
-
release/- Release preparation branches- Created from
devwhen preparing a new release - Merged to
mainwhen release is ready - Naming:
release/EWM-XXX_version_feature(e.g.,release/EWM-492_1.4.1_update_screen)
- Created from
Every branch should be associated with one or more YouTrack tickets:
-
Include ticket ID in branch name - Always prefix branch names with the YouTrack ticket ID
- Example:
feature/EWM-511_typesafe_navigation
- Example:
-
Multi-task branches - For branches that contain multiple features or fixes, include all relevant IDs
- Example:
feature/EWM_511_510_428_502_449_420_450_448_447_380_515_test_branch
- Example:
-
Include ticket ID in commit messages - Reference the YouTrack ticket in all commits
- Example:
feat(EWM-511): Add route data type checking
- Example:
-
Start from
devgit checkout dev git pull origin dev git checkout -b feature/EWM-511_typesafe_navigation
For related tasks that need to be worked on together:
-
Create a multi-task branch with IDs of all tasks
git checkout -b feature/EWM_511_510_428_502_449_420_multi_task_branch
-
Merge individual task branches into the multi-task branch
git checkout feature/EWM_511_510_428_502_449_420_multi_task_branch git merge feature/EWM-511_typesafe_navigation
-
Keep branches short-lived - Aim to complete and merge features within a few days
-
Make small, focused commits - Each commit should represent a logical unit of work
-
Write descriptive commit messages - Follow conventional commits format
-
Update your branch regularly - Merge or rebase from
devfrequently -
Don't commit directly to
mainordev- Always use feature branches and PRs -
Delete branches after merging - Keep the repository clean
-
Ensure CI passes before merging - All tests must pass before a PR can be merged
- Use "Squash and merge" when merging into
dev - This maintains a clean, linear history in the
devbranch - Each feature/fix appears as a single commit with a descriptive message
- Use regular "Merge" (not squash) when merging release branches into
main - This preserves the complete commit history from the release branch
- Maintains traceability of all changes included in the release
git checkout dev
git pull
git checkout -b feature/EWM-511_typesafe_navigation
# Make changes...
git commit -m "feat(EWM-511): Add route data type checking"
git push origin feature/EWM-511_typesafe_navigation
# Create PR to devgit checkout dev
git pull
git checkout -b fix/EWM-507_crash_on_startup
# Fix the bug...
git commit -m "fix(EWM-507): Resolve crash on startup due to null pointer"
git push origin fix/EWM-507_crash_on_startup
# Create PR to devgit checkout feature/your-branch
git fetch origin
git merge origin/dev
# Resolve any conflicts
git commit -m "merge: Sync with latest dev changes"
git push origin feature/your-branch