Skip to content

Commit dbe69d5

Browse files
authored
Merge pull request #45 from MikDal002/feature/44-define-and-document-branching-strategy-gitversion-configuration
📝 docs(branching-strategy): add detailed explanation and diagram for GitFlow and GitVersion usage
2 parents 86be3a8 + ad590f2 commit dbe69d5

File tree

2 files changed

+128
-7
lines changed

2 files changed

+128
-7
lines changed

GitVersion.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
workflow: GitFlow/v1 # Temporarily commented out to let GitVersion infer from branches
2+
3+
branches:
4+
master:
5+
regex: ^(master|main)$
6+
label: ''
7+
increment: Patch
8+
track-merge-target: false
9+
is-release-branch: true
10+
11+
develop:
12+
regex: ^develop$
13+
label: alpha
14+
increment: Minor
15+
track-merge-target: true
16+
is-release-branch: false
17+
18+
feature:
19+
# This regex will match any branch name that is NOT 'master' or 'develop'.
20+
# It also implicitly won't match 'release/...' or 'hotfix/...' if you add those
21+
# configurations later, because those more specific regexes would match first.
22+
regex: ^(?!(master|develop|release|hotfix)$).*
23+
label: use-branch-name
24+
increment: Inherit
25+
source-branches: [develop, main, master]
26+
track-merge-target: false
27+
is-release-branch: false
28+
29+
hotfix:
30+
regex: hotfixes?[/-]
31+
label: beta
32+
increment: Patch
33+
source-branches: [master, main]
34+
track-merge-target: false
35+
is-release-branch: true
36+
37+
# Optional: Release branches (if you use them as part of GitFlow)
38+
# release:
39+
# regex: releases?[/-]
40+
# label: rc # Release Candidate (e.g., 1.0.0-rc.1)
41+
# increment: None # Version is usually set when branching from develop
42+
# prevent-increment-of-merged-branch-version: true
43+
# track-merge-target: false
44+
# is-release-branch: true

Readme.md

Lines changed: 84 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,96 @@ The newest package is available [on NuGet](https://buildstats.info/nuget/ZTR.Uti
99
Generowanie kluczy SSH
1010
========
1111

12-
W przypadku wysyłania nowych wydań na serwer za pomocą SSH powinieneś używać kluczy.
13-
Prosta instrukcja jak je generować jest tutaj: https://wiki.mikr.us/uzywaj_kluczy_ssh/
12+
W przypadku wysyłania nowych wydań na serwer za pomocą SSH powinieneś używać kluczy.
13+
Prosta instrukcja jak je generować jest tutaj: https://wiki.mikr.us/uzywaj_kluczy_ssh/
1414

15-
Krótko o projekcie
15+
Krótko o projekcie
1616
========
1717

18-
Chciałbym, aby ten projekt był zbiorem dobrych praktyk, których chcę używać, za każdym razem, gdy zaczynam nowy program.
18+
Chciałbym, aby ten projekt był zbiorem dobrych praktyk, których chcę używać, za każdym razem, gdy zaczynam nowy program.
1919

2020
Inne ciekawe szablony
2121
========
2222

23-
Tutaj prezentuję listę szablonów, które również warto rozważyć przy zaczynaniu nowych projektów:
23+
Tutaj prezentuję listę szablonów, które również warto rozważyć przy zaczynaniu nowych projektów:
2424

25-
- https://github.com/Dotnet-Boxed/Templates/ - w tym projekcie są fajnie rozwinięte projekty aplikacji serwerowych (API, GraphQL, Orleans)
25+
- https://github.com/Dotnet-Boxed/Templates/ - w tym projekcie są fajnie rozwinięte projekty aplikacji serwerowych (API, GraphQL, Orleans)
2626

27-
- https://github.com/dotnet/templating/wiki/Available-templates-for-dotnet-new - lista różnych projektów z szablonami
27+
- https://github.com/dotnet/templating/wiki/Available-templates-for-dotnet-new - lista różnych projektów z szablonami
28+
29+
## Branching Strategy and Versioning
30+
31+
This project uses a GitFlow-inspired branching model, automated with GitVersion. This ensures consistent versioning and a clear workflow for development, features, and fixes.
32+
33+
**Main Branches:**
34+
35+
* **`master`**:
36+
* Represents the production-ready state of the project.
37+
* Commits are typically merges from `develop` (for releases) or `hotfix` branches.
38+
* **Versioning (GitVersion):**
39+
* Format: `Major.Minor.Patch` (e.g., `1.0.0`, `1.1.0`, `1.1.1`).
40+
* `increment: Patch` (though the version is usually determined by the branch being merged).
41+
* `tag: ''` (no pre-release tag).
42+
43+
* **`develop`**:
44+
* Serves as the main integration branch for new features. All feature branches are merged into `develop`.
45+
* When `develop` is stable and ready for a release, it's merged into `master`.
46+
* **Versioning (GitVersion):**
47+
* Format: `Major.Minor.Patch-alpha.Commits` (e.g., `1.1.0-alpha.1`, `1.2.0-alpha.5`).
48+
* `increment: Minor` (advances the minor version based on `master` due to `track-merge-target: true`).
49+
* `tag: alpha`.
50+
51+
**Supporting Branches:**
52+
53+
* **`feature/*`** (e.g., `feature/new-user-auth`):
54+
* Branched from `develop` for new development work.
55+
* Merged back into `develop` upon completion.
56+
* **Versioning (GitVersion):**
57+
* Format: `InheritedBaseVersion-BranchName.Commits` (e.g., `1.1.0-new-user-auth.3` if branched from `develop` at `1.1.0-alpha.x`).
58+
* `increment: Inherit`.
59+
* `tag: use-branch-name`.
60+
61+
* **`hotfix/*`** (e.g., `hotfix/critical-security-patch`):
62+
* Branched from `master` to address urgent production issues.
63+
* Merged back into both `master` (to release the fix) and `develop` (to ensure the fix is in future development).
64+
* **Versioning (GitVersion):**
65+
* Format: `MasterBaseVersion.PatchIncrement-beta.Commits` (e.g., `1.1.1-beta.1` if `master` was `1.1.0`).
66+
* `increment: Patch`.
67+
* `tag: beta`.
68+
69+
**Workflow Diagram:**
70+
71+
```mermaid
72+
gitGraph
73+
branch master
74+
checkout master
75+
commit tag: "1.0.0"
76+
branch develop
77+
checkout develop
78+
commit tag: "1.1.0-alpha.1"
79+
branch feature/new-login
80+
checkout feature/new-login
81+
commit tag: "1.1.0-new-login.1"
82+
checkout develop
83+
merge feature/new-login tag: "1.1.0-alpha.2"
84+
commit tag: "1.1.0-alpha.3"
85+
checkout master
86+
merge develop tag: "1.1.0"
87+
checkout develop
88+
commit tag: "1.2.0-alpha.0"
89+
checkout master
90+
branch hotfix/critical-bug-fix
91+
checkout hotfix/critical-bug-fix
92+
commit tag: "1.1.1-beta.1"
93+
checkout master
94+
merge hotfix/critical-bug-fix tag: "1.1.1"
95+
checkout develop
96+
merge hotfix/critical-bug-fix tag: "1.2.0-alpha.1"
97+
```
98+
**`GitVersion.yml` Configuration:**
99+
100+
The versioning is controlled by the [`GitVersion.yml`](GitVersion.yml:1) file. The key aspects are reflected in the branch descriptions above.
101+
The final confirmation and potential adjustments to this file are tracked in GitHub Issue [#44](https://github.com/MikDal002/ZTR.Templates/issues/44).
102+
103+
---
104+
*This documentation is related to GitHub Issue [#44](https://github.com/MikDal002/ZTR.Templates/issues/44): Define and Document Branching Strategy & GitVersion Configuration.*

0 commit comments

Comments
 (0)