GitInfo
GitInfo copied to clipboard
"Available constants" are undocumented.
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
- The URL of the default git-remote. Same as
- $(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
- first 7-char of git commit hash, similar to what's shown by
- $(GitCommitDate)
- date of the commit
- $(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 ofgit describe --tags
, except no tag name is included unless the current commit is tagged.
- the tag if the current commit is tagged. If the current commit is not tagged, it's
- $(GitBaseTag)
- Most recent Git Tag (in an ancestor commit) matched by the
GitTagRegex
- Most recent Git Tag (in an ancestor commit) matched by the
- $(GitBaseVersionMajor)
- Major version parsed from the
GitBaseVersionRegex
- Major version parsed from the
- $(GitBaseVersionMinor)
- Minor version parsed from the
GitBaseVersionRegex
- Minor version parsed from the
- $(GitBaseVersionPatch)
- Patch version parsed from the
GitBaseVersionRegex
- Patch version parsed from the
- $(GitSemVerMajor)
- Same as
GitBaseVersionMajor
- Same as
- $(GitSemVerMinor)
- Same as
GitBaseVersionMinor
- Same as
- $(GitSemVerPatch)
- Summation of
GitBaseVersionPatch
andGitCommits
. 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.
- Summation of
- $(GitSemVerLabel)
- The label parsed from the
GitBaseVersionRegex
- The label parsed from the
- $(GitSemVerDashLabel)
- Same as
GitSemVerLabel
, but preceded by a dash. This is useful for reducing conditional statements when the label is optional
- Same as
- $(GitSemVerSource)
- Indicates whether the version came from the Version
File
or a parsing aTag
- Indicates whether the version came from the Version
- $(GitIsDirty)
- 1 if working directory was dirty during build time, 0 if working directory was clean