@@ -6,61 +6,97 @@ RedirectFrom:
6
6
- docs/git-branching-strategies/gitflow-examples
7
7
---
8
8
9
- These examples are using the _ default_ configuration with GitVersion. Which is
10
- [ continuous deployment] ( /docs/reference/modes/continuous-deployment ) mode for
11
- ` develop ` and [ continuous delivery] ( /docs/reference/modes/continuous-delivery ) mode
12
- for all other branches.
13
-
14
- This default configuration allows you to publish CI builds from develop to a CI
15
- MyGet feed, or another CI feed. Then all other branches are manually released
16
- then tagged. Read more about this at [ version increments] ( /docs/reference/version-increments ) .
9
+ These examples are illustrating the usage of the supported ` GitFlow ` workflow
10
+ in GitVersion. To enable this workflow, the builtin template
11
+ [ GitFlow/v1] ( /docs/workflows/GitFlow/v1.json ) needs to be referenced in the
12
+ configuration as follows:
13
+ ``` yaml
14
+ workflow : GitFlow/v1
15
+ mode : ContinuousDelivery
16
+ ` ` `
17
+
18
+ Where
19
+ the [continuous deployment][continuous-deployment] mode for no branches,
20
+ the [continuous delivery][continuous-delivery] mode for
21
+ ` main`, `support` and `develop` branches and
22
+ the [manual deployment][manual-deployment] mode
23
+ for `release`, `feature`, `hotfix` and `unknown` branches are specified.
24
+
25
+ This configuration allows you to publish CI (Continuous Integration) builds
26
+ from `main`, `support` and `develop` branches to an artifact repository.
27
+ All other branches are manually published. Read more about this at
28
+ [version increments](/docs/reference/version-increments).
29
+
30
+ :::{.alert .alert-info}
31
+ The _continuous delivery_ mode has been used for the `main` and the
32
+ ` support` branch in this examples (specified as a fallback on the root
33
+ configuration layer) to illustrate how the version increments are applied.
34
+ In production context the _continuous deployment_ mode might be a better
35
+ option when e.g. the release process is automated or the commits are tagged
36
+ by the pipeline automatically.
37
+ :: :
17
38
18
39
# # Feature Branches
19
40
20
- Feature branches will take the feature branch name and use that as the
21
- pre-release tag.
41
+ Feature branches can be used in the `GitFlow` workflow to implement a
42
+ feature in an isolated environment. Feature branches will take the feature
43
+ branch name and use that as the pre-release label. Feature branches will be
44
+ created from a `develop`, `release`, `main`, `support` or `hotfix` branch.
22
45
23
- ![ GitFlow ] ( /docs/img/05119d0cd4ecaaefff94 \_ feature- branch.png )
46
+ # ## Create feature branch from main
24
47
25
- Notice after the feature branch is merged, the version on ` develop ` is
26
- ` 1.3.0-alpha.3 ` . This is due to ` develop ` running in _ continuous deployment_
27
- mode. If you configured ` develop ` to use _ continuous delivery_ the version would
28
- still be ` 1.3.0-alpha.1 ` and you would have to use release tags to increment the
29
- ` alpha.1 ` .
48
+ 
30
49
31
- You can see the difference on the feature branch itself, notice the version is
32
- the same before and after the commit on the feature branch? Only the metadata
33
- has changed. If you released the feature branch artifacts then tagged the
34
- commit, the following commit would increase to ` -beta.2 ` .
50
+ :::{.alert .alert-info}
51
+ After the feature branch is merged, the version on `main` is `2.0.0-5`.
52
+ This is due to `main` running in _continuous delivery_ mode. If `main` was
53
+ configured to use _continuous deployment_ the version would be `2.0.0`.
54
+ :: :
35
55
36
- ## Pull Request
56
+ # ## Create feature branch from develop
37
57
38
- Because feature branches are most likely pushed to a fork, we are showing the
39
- pull request branch name which is created when you submit a pull request
58
+ 
40
59
41
- ![ GitFlow] ( /docs/img/09fdf46995b771f3164a_pull-request.png )
60
+ :::{.alert .alert-info}
61
+ After the feature branch is merged, the version on `develop` is
62
+ ` 1.3.0-alpha.3` . This is due to `develop` running in _continuous delivery_
63
+ mode. If `develop` was configured to use _manual deployment_ the version
64
+ would still be `1.3.0-alpha.1` and you would have to use pre-release tags
65
+ to increment the pre-release label `alpha.1`.
66
+ :: :
42
67
43
68
# # Hotfix Branches
44
69
45
- Hotfix branches are used when you need to do a _ patch_ release in GitFlow and
46
- are always created off ` main `
70
+ Hotfix branches are used when you need to do a _patch_ release in the
71
+ ` GitFlow` workflow and are always created from `main` branch.
72
+
73
+ # ## Create hotfix branch
74
+
75
+ 
76
+
77
+ # ## Create hotfix branch with version number
78
+
79
+ 
47
80
48
- ![ GitFlow ] ( /docs/img/f26ae57adbd9b74f74c4 \_ hotfix.png )
81
+ # # Release Branches
49
82
50
- ## Minor Release Branches
83
+ Release branches are used for major and minor releases to stabilize a RC
84
+ (Release Candidate) or to integrate features (in parallel) targeting different
85
+ iterations. Release branches are taken from `main` (or from `develop`) and will
86
+ be merged back afterwards. Finally the `main` branch is tagged with the
87
+ released version.
51
88
52
- Release branches are used for both major and minor releases for stabilisation
53
- before a release. Release branches are taken off ` develop ` then merged to both
54
- ` develop ` and ` main ` . Finally ` main ` is tagged with the released version.
89
+ # ## Create release branch
55
90
56
- ![ GitFlow] ( /docs/img/6d33d35a70a777608fa1 \_ minor-release .png )
91
+ 
57
92
58
- ## Major Release Branches
93
+ # ## Create release branch with version
59
94
60
- Major releases are just like minor releases, the difference is you bump the
61
- major in the release branch name.
95
+ 
62
96
63
- ![ GitFlow] ( /docs/img/39f9d8b8b007c82f1f80\_ major-release.png )
97
+ # # Develop Branch
98
+
99
+ 
64
100
65
101
# # Support Branches
66
102
@@ -71,23 +107,24 @@ majors, then name your branch `support/<major>.x` (i.e `support/1.x`), to
71
107
support minors use `support/<major>.<minor>.x` or `support/<major>.<minor>.0`.
72
108
(i.e `support/1.3.x` or `support/1.3.0`)
73
109
74
- ### Hotfix
75
-
76
- Depending on what you name your support branch, you may or may not need a hotfix
77
- branch. Naming it ` support/1.x ` will automatically bump the patch, if you name
78
- it ` support/1.3.0 ` then the version in branch name rule will kick in and the
79
- patch _ will not_ automatically bump, meaning you have to use hotfix branches.
80
- ![ GitFlow] ( /docs/img/b035b8ca99bd34239518\_ support-hotfix.png )
110
+ 
81
111
82
- ### Minor Release
83
-
84
- ![ GitFlow] ( /docs/img/2167fb1c4a5cf84edfd8\_ support-minor.png )
112
+ :::{.alert .alert-info}
113
+ Depending on what you name your support branch, you may or may not need a
114
+ hotfix branch. Naming it `support/1.x` will automatically bump the patch,
115
+ if you name it `support/1.3.0` then the version in branch name rule will
116
+ kick in and the patch _will not_ automatically bump, meaning you have to
117
+ use hotfix branches.
118
+ :: :
85
119
86
120
# # To Contribute
87
121
88
122
See [contributing examples](/docs/learn/branching-strategies/contribute-examples).
89
123
90
124
# ## Source
91
125
92
- See ` DocumentationSamples.GitFlowExample ` . To update, modify then run test.
93
- Update < https://gist.github.com/JakeGinnivan/cf053d7f5d336ae9f7bb >
126
+ See `DocumentationSamplesForGitFlow.cs`. To update, modify then run test.
127
+
128
+ [continuous-deployment] : /docs/reference/modes/continuous-deployment
129
+ [continuous-delivery] : /docs/reference/modes/continuous-delivery
130
+ [manual-deployment] : /docs/reference/modes/manual-deployment
0 commit comments