Skip to content

Commit 0fa7198

Browse files
SRNissenarturcic
authored andcommitted
docs: Guidance on git tagging
1 parent 3076a8e commit 0fa7198

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

docs/input/docs/reference/version-increments.md

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,16 @@ patch-version-bump-message: "^(fix|perf)(\\([\\w\\s-,/\\\\]*\\))?:"
103103
This will ensure that your version gets bumped according to the commits you've
104104
created.
105105

106-
If your CI/CD workflow uses semantic-release's commit-analyzer, change `(fix|perf)` to `(fix|perf|revert)`. [Why?](https://github.com/semantic-release/commit-analyzer/blob/75c9c87c88772d7ded4ca9614852b42519e41931/lib/default-release-rules.js#L8C1-L8C38)
106+
If your CI/CD workflow uses semantic-release's commit-analyzer, change
107+
`(fix|perf)` to `(fix|perf|revert)`.
108+
[Why?](https://github.com/semantic-release/commit-analyzer/blob/75c9c87c88772d7ded4ca9614852b42519e41931/lib/default-release-rules.js#L8C1-L8C38)
107109

108-
Alternatively, you can override this rule in the [configuration](https://github.com/semantic-release/commit-analyzer/tree/master#usage) of \@semantic-release/commit-analyzer. If you intend to write rules with patterns, note that instead of using Regular Expression, \@semantic-release/commit-analyzer uses [micromatch's glob implementation](https://github.com/micromatch/micromatch#matching-features).
110+
Alternatively, you can override this rule in the
111+
[configuration](https://github.com/semantic-release/commit-analyzer/tree/master#usage)
112+
of \@semantic-release/commit-analyzer. If you intend to write rules with
113+
patterns, note that instead of using Regular Expression,
114+
\@semantic-release/commit-analyzer uses
115+
[micromatch's glob implementation](https://github.com/micromatch/micromatch#matching-features).
109116

110117
### GitVersion.yml
111118

@@ -130,11 +137,17 @@ By tagging a commit, GitVersion will use that tag for the version of that
130137
commit, then increment the next commit automatically based on the increment
131138
rules for that branch (some branches bump patch, some minor).
132139

140+
Be aware that tags are local to a repository and will not be transferred when
141+
you perform a default `git push`. Instead, tags can be pushed separately with
142+
their own command. For more information, read the git documentation on tagging
143+
at [git-scm.com][git-tagging].
144+
145+
133146
### Incrementing per commit
134147

135-
When using the continuous deployment `mode` (which will increment the SemVer every
136-
commit) all builds _must_ have a pre-release tag, except for builds that are
137-
explicitly tagged as stable.
148+
When using the continuous deployment `mode` (which will increment the SemVer
149+
every commit) all builds _must_ have a pre-release tag, except for builds that
150+
are explicitly tagged as stable.
138151

139152
Then the build metadata (which is the commit count) is promoted to the
140153
pre-release tag. Applying these rules, the above commit-graph would produce:
@@ -152,7 +165,8 @@ b5d142 -> 2.0.0-ci.0 (2.0.0 branch was merged, so main is now at 2.0.0)
152165

153166
As you can see, the versions now no longer conflict. When you want to create a
154167
stable `2.0.0` release you simply `git tag 2.0.0`, then build the tag, and it
155-
will produce a stable `2.0.0` package.
168+
will produce a stable `2.0.0` package. Be aware that
169+
[tags are not transferred with `git push`](#tagging-commit)
156170

157171
For more information/background on why we have come to this conclusion, read
158172
[Xavier Decoster's blog post on the subject][auto-incremented-nuget-package].
@@ -161,3 +175,4 @@ For more information/background on why we have come to this conclusion, read
161175
[continuous-delivery]: /docs/reference/modes/continuous-delivery
162176
[conventional-commits]: https://www.conventionalcommits.org/
163177
[faq-branch-name-source]: /docs/learn/faq#merged-branch-names-as-version-source
178+
[git-tagging]: https://git-scm.com/book/en/v2/Git-Basics-Tagging

0 commit comments

Comments
 (0)