Skip to content

Commit 9d3149c

Browse files
committed
Merge pull request #713 from okb/feature/improve-documentation
Improve documentation
2 parents d7c9d06 + 339b566 commit 9d3149c

File tree

2 files changed

+43
-15
lines changed

2 files changed

+43
-15
lines changed

docs/configuration.md

Lines changed: 42 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,40 @@ You can run `GitVersion /showConfig` to see the effective configuration (default
1313
To create your config file just type `GitVersion init` in your repo directory after installing via chocolatey and we will create a sample (but commented out) config file.
1414
Uncomment and modify as you need.
1515

16-
The configuration options are:
16+
## Global configuration
17+
The global configuration options are:
1718

18-
- `next-version`: Allows you to bump the next version explicitly, useful for bumping `master` or a feature with breaking changes a major increment.
19-
- `assembly-versioning-scheme`: When updating assembly info tells GitVersion how to treat the AssemblyVersion attribute. Useful to lock the major when using Strong Naming.
20-
- `mode`: Either [ContinuousDelivery](/reference/continuous-delivery/) or [ContinuousDeployment](/reference/continuous-deployment/).
21-
- `Continuous-Delivery-fallback-tag`: When using `mode: ContinuousDeployment` the value specified will be used as the pre-release tag for branches which do not have one specified.
22-
- `tag-prefix`: A regex which is used to trim git tags before processing (eg v1.0.0). Default is `[vV]` though this is just for illustrative purposes as we do a IgnoreCase match and could be `v`
19+
- **`next-version:`** Allows you to bump the next version explicitly, useful for bumping `master` or a feature with breaking changes a major increment.
20+
21+
- **`assembly-versioning-scheme:`** When updating assembly info tells GitVersion how to treat the `AssemblyVersion` attribute. Useful to lock the major when using Strong Naming.
22+
23+
- **`assembly-informational-format:`** Set this to any of the available [variables](/more-info/variables) to change the value of the `AssemblyInformationalVersion` attribute. Default set to `{InformationalVersion}`.
24+
25+
- **`mode:`** Sets the mode of how GitVersion should create a new version. Can be set to either `ContinuousDelivery` or `ContinuousDeployment`. Read more about [ContinuousDelivery](/reference/continuous-delivery/) or [ContinuousDeployment](/reference/continuous-deployment/).
26+
27+
- **`continuous-delivery-fallback-tag:`** When using `mode: ContinuousDeployment`, the value specified will be used as the pre-release tag for branches which do not have one specified. Default set to `ci`.
28+
29+
- **`tag-prefix:`** A regex which is used to trim git tags before processing (eg v1.0.0). Default is `[vV]` though this is just for illustrative purposes as we do a IgnoreCase match and could be `v`.
30+
31+
- **`major-version-bump-message:`** The regex to match commit messages with to perform a major version increment. Default set to `'\+semver:\s?(breaking|major)'`, which will match occurrences of `+semver: major` and `+semver: breaking` in a commit message.
32+
33+
- **`minor-version-bump-message:`** The regex to match commit messages with to perform a minor version increment. Default set to `'\+semver:\s?(feature|minor)'`, which will match occurrences of `+semver: feature` and `+semver: minor` in a commit message.
34+
35+
- **`patch-version-bump-message:`** The regex to match commit messages with to perform a patch version increment. Default set to `'\+semver:\s?(fix|patch)'`, which will match occurrences of `+semver: fix` and `+semver: patch` in a commit message.
36+
37+
- **`legacy-semver-padding:`** The number of characters to pad `LegacySemVer` to in the `LegacySemVerPadded` [variable](/more-info/variables). Is default set to `4`, which will pad the `LegacySemVer` value of `3.0.0-beta1` to `3.0.0-beta0001`.
38+
39+
- **`build-metadata-padding:`** The number of characters to pad `BuildMetaData` to in the `BuildMetaDataPadded` [variable](/more-info/variables). Is default set to `4`, which will pad the `BuildMetaData` value of `1` to `0001`.
40+
41+
- **`commits-since-version-source-padding:`** The number of characters to pad `CommitsSinceVersionSource` to in the `CommitsSinceVersionSourcePadded` [variable](/more-info/variables). Is default set to `4`, which will pad the `CommitsSinceVersionSource` value of `1` to `0001`.
42+
43+
- **`commit-message-incrementing:`** Sets whether it should be possible to increment the version with special syntax in the commit message. See the `*-version-bump-message` options above for details on the syntax. Default set to `Enabled`; set to `Disabled` to disable.
2344

2445
## Branch configuration
2546

2647
Then we have branch specific configuration, which looks something like this:
2748

28-
``` yaml
49+
```yaml
2950
branches:
3051
master:
3152
tag:
@@ -34,19 +55,25 @@ branches:
3455
(pull|pull\-requests|pr)[/-]:
3556
tag: PullRequest
3657
increment: Inherit
58+
track-merge-target: true
3759
tag-number-pattern: '[/-](?<number>\d+)[-/]'
3860
```
3961
4062
The options in here are:
41-
- `mode`: Same as above
42-
- `tag`: The pre release tag to use for this branch. Use the value `use-branch-name-as-tag` to use the branch name instead.
63+
64+
- **`mode:`** Same as above
65+
66+
- **`tag:`** The pre release tag to use for this branch. Use the value `use-branch-name-as-tag` to use the branch name instead.
4367
For example `feature/foo` would become a pre-release tag of `foo` with this value
44-
- `increment`: the part of the SemVer to increment when GitVersion detects it needs to be (i.e commit after a tag)
45-
- `prevent-increment-of-merged-branch-version`: When `release-2.0.0` is merged into master, we want master to build `2.0.0`.
68+
69+
- **`increment:`** the part of the SemVer to increment when GitVersion detects it needs to be (i.e commit after a tag)
70+
71+
- **`prevent-increment-of-merged-branch-version:`** When `release-2.0.0` is merged into master, we want master to build `2.0.0`.
4672
If `release-2.0.0` is merged into develop we want it to build `2.1.0`, this option prevents incrementing after a versioned branch is merged
47-
- `tag-number-pattern`: Pull requests require us to pull the pre-release number out of the branch name so `refs/pulls/534/merge` builds as `PullRequest.5`.
73+
74+
- **`tag-number-pattern:`** Pull requests require us to pull the pre-release number out of the branch name so `refs/pulls/534/merge` builds as `PullRequest.5`.
4875
This is a regex with a named capture group called `number`
49-
- `track-merge-target`: Strategy which will look for tagged merge commits directly off the current branch. For example
50-
develop -> release/1.0.0 -> merge into master and tag 1.0.0. The tag is *not* on develop, but develop should be 1.0.0 now.
5176

52-
We don't envision many people needing to change most of these configuration values, but they are there if you need to.
77+
- **`track-merge-target:`** Strategy which will look for tagged merge commits directly off the current branch. For example `develop` → `release/1.0.0` → merge into `master` and tag `1.0.0`. The tag is *not* on develop, but develop should be version `1.0.0` now.
78+
79+
We don't envision many people needing to change most of these configuration values, but they are there if you need to.

src/GitVersionExe/HelpWriter.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Specify name of AssemblyInfo file. Can also /updateAssemblyInfo GlobalAssemblyIn
4040
/c The commit id to check. If not specified, the latest available commit on the specified branch will be used.
4141
/dynamicRepoLocation
4242
By default dynamic repositories will be cloned to %tmp%. Use this switch to override
43+
/nofetch Disables 'git fetch' during version calculation. Might cause GitVersion to not calculate your version as expected.
4344
4445
# Execute build args
4546
/exec Executes target executable making GitVersion variables available as environmental variables

0 commit comments

Comments
 (0)