Not all of the available constants are immediately obvious. It would be nice if they were documented similar to the available customizations.
- $(GitRepositoryUrl)
- The URL of the default git-remote. Same as
git remote get-url origin
- $(GitBranch)
- The name of the currently checked out branch
- $(GitCommit)
- first 7-char of git commit hash, similar to what's shown by
git describe
- $(GitCommitDate)
- $(GitCommits)
- number of commits since the last BaseVersion change. This is 0 if the BaseVersion was changed in this commit.
- $(GitTag)
- the tag if the current commit is tagged. If the current commit is not tagged, it's
-{added_commits}-g$(GitCommit) where {added_commits} is the commits added since the last tag. This is similar to the output of git describe --tags, except no tag name is included unless the current commit is tagged.
- $(GitBaseTag)
- Most recent Git Tag (in an ancestor commit) matched by the
GitTagRegex
- $(GitBaseVersionMajor)
- Major version parsed from the
GitBaseVersionRegex
- $(GitBaseVersionMinor)
- Minor version parsed from the
GitBaseVersionRegex
- $(GitBaseVersionPatch)
- Patch version parsed from the
GitBaseVersionRegex
- $(GitSemVerMajor)
- Same as
GitBaseVersionMajor
- $(GitSemVerMinor)
- Same as
GitBaseVersionMinor
- $(GitSemVerPatch)
- Summation of
GitBaseVersionPatch and GitCommits. This is useful for automatically increasing the Patch value whenever commits are made without the need to manually edit the Version File or add a new tag.
- $(GitSemVerLabel)
- The label parsed from the
GitBaseVersionRegex
- $(GitSemVerDashLabel)
- Same as
GitSemVerLabel, but preceded by a dash. This is useful for reducing conditional statements when the label is optional
- $(GitSemVerSource)
- Indicates whether the version came from the Version
File or a parsing a Tag
- $(GitIsDirty)
- 1 if working directory was dirty during build time, 0 if working directory was clean
Not all of the available constants are immediately obvious. It would be nice if they were documented similar to the available customizations.
git remote get-url origingit describe-{added_commits}-g$(GitCommit)where{added_commits}is the commits added since the last tag. This is similar to the output ofgit describe --tags, except no tag name is included unless the current commit is tagged.GitTagRegexGitBaseVersionRegexGitBaseVersionRegexGitBaseVersionRegexGitBaseVersionMajorGitBaseVersionMinorGitBaseVersionPatchandGitCommits. This is useful for automatically increasing the Patch value whenever commits are made without the need to manually edit the Version File or add a new tag.GitBaseVersionRegexGitSemVerLabel, but preceded by a dash. This is useful for reducing conditional statements when the label is optionalFileor a parsing aTag