Skip to main content
GitInfo package icon

GitInfo

Exposes the following information for use directly from MSBuild, C# and VB: $(GitBranch), ThisAssembly.Git.Branch $(GitCommit), ThisAssembly.Git.Commit $(GitSha), ThisAssembly.Git.Sha $(GitBaseVersionMajor), ThisAssembly.Git.BaseVersion.Major $(GitBaseVersionMinor), ThisAssembly.Git.BaseVersion.Minor $(GitBaseVersionPatch), ThisAssembly.Git.BaseVersion.Patch $(GitCommits), ThisAssembly.Git.Commits $(GitTag), ThisAssembly.Git.Tag $(GitBaseTag), ThisAssembly.Git.BaseTag $(GitSemVerMajor), ThisAssembly.Git.SemVer.Major $(GitSemVerMinor), ThisAssembly.Git.SemVer.Minor $(GitSemVerPatch), ThisAssembly.Git.SemVer.Patch $(GitSemVerLabel), ThisAssembly.Git.SemVer.Label $(GitSemVerDashLabel), ThisAssembly.Git.SemVer.DashLabel $(GitSemVerSource), ThisAssembly.Git.SemVer.Source $(GitIsDirty), ThisAssembly.Git.IsDirty The generated code contains only constants, so it can be used to construct your own assembly/file version attributes: [assembly: AssemblyVersion(ThisAssembly.Git.SemVer.Major + "." + ThisAssembly.Git.SemVer.Minor + ".0")] [assembly: AssemblyInformationalVersion(ThisAssembly.Git.SemVer.Major + "." + ThisAssembly.Git.SemVer.Minor + "." + ThisAssembly.Git.SemVer.Patch + "-" + ThisAssembly.Git.Branch + "+" + ThisAssembly.Git.Commit)]

Total Downloads
12.6M
12,594,172
Published
Jan 27, 2017
Latest stable version

Install

.NET CLI
dotnet add package GitInfo --version 1.1.44
Package Manager Console
Install-Package GitInfo -Version 1.1.44
PackageReference
<PackageReference Include="GitInfo" Version="1.1.44" />

Frameworks

No framework metadata available.

Dependencies

No declared dependencies.

Adoption guide

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

No SPDX license expression is published. Review the license text and your organisation's policy before redistribution.

No target framework metadata is available. Confirm compatibility in a representative project before standardising on this package.

How to read this guidance

Sources: published NuGet v3 registry metadata and explicit NuBrowse editorial guides. Refresh: package metadata is refreshed from NuGet when the page loads. Limit: this is not a security, legal or compatibility guarantee; validate the selected version in your project.

Useful next steps

Move from package metadata to a concrete selection or review workflow.