Git-flow Branch Lifecycle
Manage feature, hotfix, and release branch lifecycles using Git-flow conventions.
Operations Overview
| Operation | Action | Target Branch | Base Branch | Merge Target |
|---|---|---|---|---|
| Start Feature | Create branch | feature/<name> |
develop |
develop |
| Finish Feature | Merge & clean up | feature/<name> |
— | develop |
| Start Hotfix | Create branch & bump patch | hotfix/<version> |
main |
main + develop |
| Finish Hotfix | Merge, tag & clean up | hotfix/<version> |
— | main + develop |
| Start Release | Create branch & bump version | release/<version> |
develop |
main + develop |
| Finish Release | Merge, tag & clean up | release/<version> |
— | main + develop |
Workflow Routing
1. Starting a Branch (start)
Follow the start pipeline in references/gitflow-start-pipeline.md:
- Pre-flight invariants: Verify working tree is clean (
git status --porcelainis empty) perreferences/invariants.md. - Resolve Name/Version: Infer or parse target branch name or semver version from
$ARGUMENTS. - Execute Start: Run
scripts/start-branch.shwith--type <feature|hotfix|release>and--name <NAME_OR_TARGET>.
2. Finishing a Branch (finish)
Follow the finish pipeline in references/gitflow-finish-pipeline.md:
- Pre-flight invariants: Verify working tree is clean and current branch matches
<type>/*perreferences/invariants.md. - Run Tests: Verify project test suite passes before proceeding.
- Update Changelog: Collect commits per
references/changelog-generation.md, format followingreferences/changelog-example.md, and commit with attribution perreferences/coauthor-attribution.md. - Execute Finish: Run
scripts/finish-branch.shwith--type <feature|hotfix|release>and--name $NAMEor--version $VERSION. - Post-finish Cleanup: Prune stale branches and worktrees per
references/cleanup.md.
Supporting References & Scripts
- Start Pipeline:
references/gitflow-start-pipeline.md - Finish Pipeline:
references/gitflow-finish-pipeline.md - Pre-flight Invariants:
references/invariants.md - Changelog Generation:
references/changelog-generation.md - Changelog Example:
references/changelog-example.md - Co-author Attribution:
references/coauthor-attribution.md - Branch & Worktree Cleanup:
references/cleanup.md - Start Branch Script:
scripts/start-branch.sh - Finish Branch Script:
scripts/finish-branch.sh