@@ -31,18 +31,28 @@ found that is generally what is needed when using GitFlow.
31
31
To see the effective configuration (defaults and overrides), you can run
32
32
` gitversion /showConfig ` .
33
33
34
- To create your config file just type ` gitversion init ` in your repo directory,
35
- after [ installing] [ installing ] . A minimal ` GitVersion.yml ` configuration file will be
36
- created. Modify this to suit your needs.
37
34
38
35
## Global configuration
39
36
40
- The global configuration looks like this:
37
+ The following supported workflow configurations are available in GitVersion and can be referenced by the workflow property:
38
+ - GitFlow (GitFlow/v1)
39
+ - GitHubFlow (GitHubFlow/v1)
40
+ - TrunkBased (TrunkBased/v1)
41
+
42
+ Example of using a ` TrunkBased ` workflow with a different ` tag-prefix ` :
43
+
44
+ ``` yaml
45
+ workflow : TrunkBased/v1
46
+ tag-prefix : ' [abc]'
47
+ ` ` `
48
+
49
+ The built-in configuration for the ` GitFlow` workflow (`workflow: GitFlow/v1`) looks like:
41
50
42
51
` ` ` yaml
43
52
assembly-versioning-scheme: MajorMinorPatch
44
53
assembly-file-versioning-scheme: MajorMinorPatch
45
54
tag-prefix: '[vV]?'
55
+ version-in-branch-pattern: (?<version>[vV]?\d +(\.\d +)?(\.\d +)?).*
46
56
major-version-bump-message: '\+ semver:\s ?(breaking|major)'
47
57
minor-version-bump-message: '\+ semver:\s ?(feature|minor)'
48
58
patch-version-bump-message: '\+ semver:\s ?(fix|patch)'
@@ -52,16 +62,22 @@ commit-date-format: yyyy-MM-dd
52
62
merge-message-formats: {}
53
63
update-build-number: true
54
64
semantic-version-format: Strict
55
- strategies : [ConfigNext, MergeMessage, TaggedCommit, TrackReleaseBranches, VersionInBranchName]
65
+ strategies:
66
+ - ConfiguredNextVersion
67
+ - MergeMessage
68
+ - TaggedCommit
69
+ - TrackReleaseBranches
70
+ - VersionInBranchName
56
71
branches:
57
72
develop:
58
- mode : ContinuousDeployment
59
73
label: alpha
60
74
increment: Minor
61
75
prevent-increment-of-merged-branch-version: false
76
+ prevent-increment-when-tagged: false
62
77
track-merge-target: true
63
78
regex: ^dev(elop)?(ment)?$
64
79
source-branches: []
80
+ is-source-branch-for: []
65
81
tracks-release-branches: true
66
82
is-release-branch: false
67
83
is-main-branch: false
@@ -75,27 +91,31 @@ branches:
75
91
source-branches:
76
92
- develop
77
93
- release
94
+ is-source-branch-for: []
78
95
tracks-release-branches: false
79
96
is-release-branch: false
80
97
is-main-branch: true
81
98
pre-release-weight: 55000
82
99
release:
100
+ mode: ManualDeployment
83
101
label: beta
84
102
increment: None
85
103
prevent-increment-of-merged-branch-version: true
104
+ prevent-increment-when-tagged: false
86
105
track-merge-target: false
87
106
regex: ^releases?[/-]
88
107
source-branches:
89
108
- develop
90
109
- main
91
110
- support
92
111
- release
112
+ is-source-branch-for: []
93
113
tracks-release-branches: false
94
114
is-release-branch: true
95
115
is-main-branch: false
96
116
pre-release-weight: 30000
97
117
feature:
98
- mode : ContinuousDelivery
118
+ mode: ManualDeployment
99
119
label: '{BranchName}'
100
120
increment: Inherit
101
121
regex: ^features?[/-](?<BranchName>.+)
@@ -106,6 +126,7 @@ branches:
106
126
- feature
107
127
- support
108
128
- hotfix
129
+ is-source-branch-for: []
109
130
pre-release-weight: 30000
110
131
pull-request:
111
132
mode: ContinuousDelivery
@@ -120,17 +141,21 @@ branches:
120
141
- feature
121
142
- support
122
143
- hotfix
144
+ is-source-branch-for: []
123
145
pre-release-weight: 30000
124
146
hotfix:
125
- mode : ContinuousDelivery
147
+ mode: ManualDeployment
126
148
label: beta
127
149
increment: Inherit
150
+ prevent-increment-when-tagged: false
128
151
regex: ^hotfix(es)?[/-]
129
152
source-branches:
130
153
- release
131
154
- main
132
155
- support
133
156
- hotfix
157
+ is-source-branch-for: []
158
+ is-release-branch: true
134
159
pre-release-weight: 30000
135
160
support:
136
161
label: ''
@@ -140,15 +165,16 @@ branches:
140
165
regex: ^support[/-]
141
166
source-branches:
142
167
- main
168
+ is-source-branch-for: []
143
169
tracks-release-branches: false
144
170
is-release-branch: false
145
171
is-main-branch: true
146
172
pre-release-weight: 55000
147
173
unknown:
148
- mode : ContinuousDelivery
174
+ mode: ManualDeployment
149
175
label: '{BranchName}'
150
176
increment: Inherit
151
- regex : (?<BranchName>.* )
177
+ regex: (?<BranchName>.+ )
152
178
source-branches:
153
179
- main
154
180
- develop
@@ -157,12 +183,200 @@ branches:
157
183
- pull-request
158
184
- hotfix
159
185
- support
186
+ is-source-branch-for: []
187
+ ignore:
188
+ sha: []
189
+ mode: ContinuousDelivery
190
+ label: '{BranchName}'
191
+ increment: Inherit
192
+ prevent-increment-of-merged-branch-version: false
193
+ prevent-increment-when-tagged: true
194
+ track-merge-target: false
195
+ track-merge-message: true
196
+ commit-message-incrementing: Enabled
197
+ regex: ''
198
+ source-branches: []
199
+ is-source-branch-for: []
200
+ tracks-release-branches: false
201
+ is-release-branch: false
202
+ is-main-branch: false
203
+ ` ` `
204
+
205
+ The supported built-in configuration for the `GitHubFlow` workflow (`workflow : GitHubFlow/v1`) looks like:
206
+
207
+ ` ` ` yaml
208
+ assembly-versioning-scheme: MajorMinorPatch
209
+ assembly-file-versioning-scheme: MajorMinorPatch
210
+ tag-prefix: '[vV]?'
211
+ version-in-branch-pattern: (?<version>[vV]?\d +(\.\d +)?(\.\d +)?).*
212
+ major-version-bump-message: '\+ semver:\s ?(breaking|major)'
213
+ minor-version-bump-message: '\+ semver:\s ?(feature|minor)'
214
+ patch-version-bump-message: '\+ semver:\s ?(fix|patch)'
215
+ no-bump-message: '\+ semver:\s ?(none|skip)'
216
+ tag-pre-release-weight: 60000
217
+ commit-date-format: yyyy-MM-dd
218
+ merge-message-formats: {}
219
+ update-build-number: true
220
+ semantic-version-format: Strict
221
+ strategies:
222
+ - ConfiguredNextVersion
223
+ - MergeMessage
224
+ - TaggedCommit
225
+ - TrackReleaseBranches
226
+ - VersionInBranchName
227
+ branches:
228
+ main:
229
+ label: ''
230
+ increment: Patch
231
+ prevent-increment-of-merged-branch-version: true
232
+ track-merge-target: false
233
+ regex: ^master$|^main$
234
+ source-branches:
235
+ - release
236
+ is-source-branch-for: []
237
+ tracks-release-branches: false
238
+ is-release-branch: false
239
+ is-main-branch: true
240
+ pre-release-weight: 55000
241
+ release:
242
+ mode: ManualDeployment
243
+ label: beta
244
+ increment: None
245
+ prevent-increment-of-merged-branch-version: true
246
+ prevent-increment-when-tagged: false
247
+ track-merge-target: false
248
+ regex: ^releases?[/-]
249
+ source-branches:
250
+ - main
251
+ - release
252
+ is-source-branch-for: []
253
+ tracks-release-branches: false
254
+ is-release-branch: true
255
+ is-main-branch: false
256
+ pre-release-weight: 30000
257
+ feature:
258
+ mode: ManualDeployment
259
+ label: '{BranchName}'
260
+ increment: Inherit
261
+ regex: ^features?[/-](?<BranchName>.+)
262
+ source-branches:
263
+ - main
264
+ - release
265
+ - feature
266
+ is-source-branch-for: []
267
+ pre-release-weight: 30000
268
+ pull-request:
269
+ mode: ContinuousDelivery
270
+ label: PullRequest
271
+ increment: Inherit
272
+ label-number-pattern: '[/-](?<number>\d +)'
273
+ regex: ^(pull|pull\- requests|pr)[/-]
274
+ source-branches:
275
+ - main
276
+ - release
277
+ - feature
278
+ is-source-branch-for: []
279
+ pre-release-weight: 30000
280
+ unknown:
281
+ mode: ManualDeployment
282
+ label: '{BranchName}'
283
+ increment: Inherit
284
+ regex: (?<BranchName>.+)
285
+ source-branches:
286
+ - main
287
+ - release
288
+ - feature
289
+ - pull-request
290
+ is-source-branch-for: []
160
291
ignore:
161
292
sha: []
162
293
mode: ContinuousDelivery
163
294
label: '{BranchName}'
164
295
increment: Inherit
165
296
prevent-increment-of-merged-branch-version: false
297
+ prevent-increment-when-tagged: true
298
+ track-merge-target: false
299
+ track-merge-message: true
300
+ commit-message-incrementing: Enabled
301
+ regex: ''
302
+ source-branches: []
303
+ is-source-branch-for: []
304
+ tracks-release-branches: false
305
+ is-release-branch: false
306
+ is-main-branch: false
307
+ ` ` `
308
+
309
+ The supported built-in configuration for the `TrunkBased` workflow (`workflow : TrunkBased/v1`) looks like:
310
+
311
+ ` ` ` yaml
312
+ assembly-versioning-scheme: MajorMinorPatch
313
+ assembly-file-versioning-scheme: MajorMinorPatch
314
+ tag-prefix: '[vV]?'
315
+ version-in-branch-pattern: (?<version>[vV]?\d +(\.\d +)?(\.\d +)?).*
316
+ major-version-bump-message: '\+ semver:\s ?(breaking|major)'
317
+ minor-version-bump-message: '\+ semver:\s ?(feature|minor)'
318
+ patch-version-bump-message: '\+ semver:\s ?(fix|patch)'
319
+ no-bump-message: '\+ semver:\s ?(none|skip)'
320
+ tag-pre-release-weight: 60000
321
+ commit-date-format: yyyy-MM-dd
322
+ merge-message-formats: {}
323
+ update-build-number: true
324
+ semantic-version-format: Strict
325
+ strategies:
326
+ - TrunkBased
327
+ - ConfiguredNextVersion
328
+ branches:
329
+ main:
330
+ mode: ContinuousDeployment
331
+ label: ''
332
+ increment: Patch
333
+ prevent-increment-of-merged-branch-version: true
334
+ track-merge-target: false
335
+ regex: ^master$|^main$
336
+ source-branches: []
337
+ tracks-release-branches: false
338
+ is-release-branch: false
339
+ is-main-branch: true
340
+ pre-release-weight: 55000
341
+ feature:
342
+ increment: Minor
343
+ regex: ^features?[/-](?<BranchName>.+)
344
+ prevent-increment-when-tagged: false
345
+ source-branches:
346
+ - main
347
+ pre-release-weight: 30000
348
+ hotfix:
349
+ increment: Patch
350
+ regex: ^hotfix(es)?[/-](?<BranchName>.+)
351
+ prevent-increment-when-tagged: false
352
+ source-branches:
353
+ - main
354
+ pre-release-weight: 30000
355
+ pull-request:
356
+ mode: ManualDeployment
357
+ label: PullRequest
358
+ increment: Inherit
359
+ label-number-pattern: '[/-](?<number>\d +)'
360
+ regex: ^(pull|pull\- requests|pr)[/-]
361
+ source-branches:
362
+ - main
363
+ pre-release-weight: 30000
364
+ unknown:
365
+ mode: ManualDeployment
366
+ increment: Inherit
367
+ regex: (?<BranchName>.+)
368
+ source-branches:
369
+ - main
370
+ - release
371
+ - feature
372
+ - pull-request
373
+ ignore:
374
+ sha: []
375
+ mode: ManualDeployment
376
+ label: '{BranchName}'
377
+ increment: Inherit
378
+ prevent-increment-of-merged-branch-version: false
379
+ prevent-increment-when-tagged: true
166
380
track-merge-target: false
167
381
track-merge-message: true
168
382
commit-message-incrementing: Enabled
@@ -176,7 +390,7 @@ The details of the available options are as follows:
176
390
177
391
# ## workflow
178
392
179
- The base template of the configuration to use. Possible values are: GitFlow/v1 or GitHubFlow/v1
393
+ The base template of the configuration to use. Possible values are : GitFlow/v1 or GitHubFlow/v1 or TrunkBased/v1. Defaults to GitFlow/v1 if not set.
180
394
181
395
# ## next-version
182
396
@@ -244,7 +458,7 @@ The default value is `{InformationalVersion}`.
244
458
# ## mode
245
459
246
460
Sets the `mode` of how GitVersion should create a new version. Read more at
247
- [versioning modes][modes].
461
+ [deployment modes][modes].
248
462
249
463
# ## increment
250
464
@@ -588,6 +802,10 @@ In a GitFlow-based repository, setting this option can have implications on the
588
802
better version source proposed by the `MergeMessageBaseVersionStrategy`. For
589
803
more details and an in-depth analysis, please see [the discussion][2506].
590
804
805
+ # ## prevent-increment-when-current-commit-tagged
806
+
807
+ This branch related property controls the behvior whether to use the tagged (value set to true) or the incremented (value set to false) semantic version. Defaults to true.
808
+
591
809
# ## label-number-pattern
592
810
593
811
Pull requests require us to extract the pre-release number out of the branch
@@ -677,9 +895,9 @@ Example of invalid `Strict`, but valid `Loose`
677
895
### strategies
678
896
679
897
Specifies which version strategy implementation (one ore more) will be used to determine the next version. Following values are supported and can be combined:
680
- * ConfiguredNextVersion
681
- * MergeMessage
682
- * TaggedCommit
683
- * TrackReleaseBranches
684
- * VersionInBranchName
685
- * TrunkBased
898
+ - ConfiguredNextVersion
899
+ - MergeMessage
900
+ - TaggedCommit
901
+ - TrackReleaseBranches
902
+ - VersionInBranchName
903
+ - TrunkBased
0 commit comments