@@ -17,6 +17,7 @@ GitFlow-inspired branching strategy for this project. Solo development omits the
1717| ` feature/* ` | New features | No |
1818| ` fix/* ` | Bug fixes | No |
1919| ` hotfix/* ` | Urgent production fixes | No |
20+ | ` release/* ` | Release preparation | Yes |
2021
2122## Branch Naming Rules
2223
@@ -26,6 +27,12 @@ GitFlow-inspired branching strategy for this project. Solo development omits the
2627- Fixes: ` fix/<descriptive-name> `
2728 - Examples: ` fix/login-error ` , ` fix/memory-leak `
2829
30+ - Hotfixes: ` hotfix/<descriptive-name> `
31+ - Examples: ` hotfix/security-patch ` , ` hotfix/critical-bug `
32+
33+ - Releases: ` release/<version> `
34+ - Examples: ` release/v1.0.0 ` , ` release/v2.1.0 `
35+
2936## Workflow
3037
3138### Creating Feature Branch
@@ -67,6 +74,39 @@ git merge hotfix/urgent-fix-description
6774git branch -d hotfix/urgent-fix-description
6875```
6976
77+ ### Creating Release Branch
78+
79+ ** Note:** Release branch is optional. For most cases, merge ` develop ` directly to ` main ` with a tag.
80+
81+ When to use release branches:
82+ - Finalizing release features
83+ - Preparing for production deployment
84+ - Testing release candidate before deployment
85+
86+ ``` bash
87+ # From develop (team only)
88+ git checkout develop
89+ git pull origin develop
90+ git checkout -b release/v1.0.0
91+
92+ # Bump version, finalize release notes, run tests
93+ # ...
94+
95+ # Merge release to main and tag
96+ git checkout main
97+ git merge release/v1.0.0
98+ git tag -a v1.0.0 -m " Release version 1.0.0"
99+ git push origin main
100+ git push origin v1.0.0
101+
102+ # Back-merge to develop
103+ git checkout develop
104+ git merge release/v1.0.0
105+
106+ # Delete release branch
107+ git branch -d release/v1.0.0
108+ ```
109+
70110### Creating Fix Branch
71111``` bash
72112# From main (solo or team)
@@ -153,6 +193,13 @@ gitGraph
153193 merge hotfix/urgent-fix tag: "v1.0.2"
154194 checkout develop
155195 merge hotfix/urgent-fix
196+ branch release/v1.1.0
197+ checkout release/v1.1.0
198+ commit
199+ checkout main
200+ merge release/v1.1.0 tag: "v1.1.0"
201+ checkout develop
202+ merge release/v1.1.0
156203```
157204
158205## Rebase Guidelines
@@ -238,8 +285,11 @@ git rebase --abort
2382858 . ** Hotfix** branches must be created from ` main ` , not ` develop `
2392869 . ** Hotfix** merges must be tagged immediately (v1.0.2, v1.0.3, etc.)
24028710 . ** Hotfix** must be back-merged to ` develop ` (if using team workflow)
241- 11 . ** Rebase** only feature/fix/hotfix branches, never main/develop
242- 12 . ** Force push** only with ` --force-with-lease ` and only on feature branches
288+ 11 . ** Release** branches must be created from ` develop ` (team workflow only)
289+ 12 . ** Release** merges to ` main ` must be tagged with new version
290+ 13 . ** Release** must be back-merged to ` develop ` after ` main ` merge
291+ 14 . ** Rebase** only feature/fix/hotfix/release branches, never main/develop
292+ 15 . ** Force push** only with ` --force-with-lease ` and only on feature branches
243293
244294## Release Process
245295
@@ -251,6 +301,8 @@ git push origin v1.0.0
251301```
252302
253303### Team Development
304+
305+ #### Option 1: Direct Merge (Recommended)
254306``` bash
255307git checkout develop
256308git checkout main
@@ -259,6 +311,30 @@ git tag -a v1.0.0 -m "Release version 1.0.0"
259311git push origin v1.0.0
260312```
261313
314+ #### Option 2: Release Branch (Formal Process)
315+ ``` bash
316+ # Create release branch from develop
317+ git checkout develop
318+ git checkout -b release/v1.0.0
319+
320+ # Finalize release (bump version, update changelog, run tests)
321+ # ...
322+
323+ # Merge release to main and tag
324+ git checkout main
325+ git merge release/v1.0.0
326+ git tag -a v1.0.0 -m " Release version 1.0.0"
327+ git push origin main
328+ git push origin v1.0.0
329+
330+ # Back-merge to develop
331+ git checkout develop
332+ git merge release/v1.0.0
333+
334+ # Delete release branch
335+ git branch -d release/v1.0.0
336+ ```
337+
262338## Conflict Resolution
263339
264340``` bash
0 commit comments