GitVersion

From git log to SemVer in no time

Semantic versioning powered by your Git history.
Automate version numbers across your builds and releases.

Getting Started

Installation

Install GitVersion as a global .NET tool.

dotnet tool install --global GitVersion.Tool --version 7.0.0

Also available for Docker and MSBuild.

Full installation guide →

Usage

Run it inside your Git repository.

# Calculate your version
dotnet-gitversion

# Print a single version variable
dotnet-gitversion --show-variable SemVer
Command-line options →

How It Works

Version Calculation Example

GitVersion reads your tags, branches, and commits to calculate a semantic version for the current commit.

Your history is the starting point

  • Tags establish released versions.
  • Branches provide context for your workflow.
  • Configuration controls increments and pre-release labels.

This example is illustrative. Your output depends on your repository history and configuration.

Learn how versions are calculated →
A HISTORY WORTH BUILDING ON
A feature branch merges back into main Commits on main and a feature branch form the history GitVersion reads. The version below is illustrative; actual output depends on your history and configuration. v1.0.0feature / nextmain
gitversionILLUSTRATIVE OUTPUT
1.1.0
"FullSemVer": "1.1.0" Ready to build
Git historyGitVersionSemantic version

Need Help?

Ask the community, report an issue, or help improve GitVersion.