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 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)]
Install
dotnet add package GitInfo --version 1.1.41
Install-Package GitInfo -Version 1.1.41
<PackageReference Include="GitInfo" Version="1.1.41" />
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.