Calculate a version for the intended commit, then pass its values to packaging and deployment steps.
Prepare the checkout
- Check out the commit you intend to version.
- Fetch the tags and branch history required by your workflow. Start with an unshallow checkout; for GitHub Actions, set
fetch-depth: 0. - Include your configuration file.
- Follow the provider guide for branch detection, pull requests, and variable scope.
See repository requirements and Troubleshooting if CI produces a different result from your local checkout.
Choose your integration
Start with GitHub Actions, Azure DevOps, or GitLab CI, or choose another provider below.
| AppVeyor | Details on the AppVeyor support in GitVersion |
| Azure DevOps | Details on the Azure DevOps Build Pipeline support in GitVersion |
| Bamboo | Details on the Bamboo support in GitVersion |
| BitBucket Pipelines | Details on the Atlassian BitBucket Pipelines support in GitVersion |
| Buildkite | Details on the Buildkite support in GitVersion |
| Continua CI | Details on the Continua CI support in GitVersion |
| GitHub Actions | Details on the GitHub Actions Workflow support in GitVersion |
| GitLab CI | Details on the GitLab CI support in GitVersion |
| Jenkins | Details on the Jenkins support in GitVersion |
| MyGet | Details on the MyGet support in GitVersion |
| Octopus Deploy | Details on the Octopus Deploy support in GitVersion |
| TeamCity | Details on the TeamCity support in GitVersion |
Build Server Variables
Run dotnet-gitversion --output buildserver to use a supported provider's native variable and build-number mechanisms. Dedicated GitTools integrations can perform these steps for you. Check the provider guide for exact variable names and how to pass them to later jobs.
MSBuild Properties
The MSBuild task exposes properties such as $(GitVersion_SemVer). See that guide for assembly and package integration.
Environment Variables
Provider integrations commonly expose values such as GitVersion_SemVer. Export mechanisms and scope differ between providers. For portable scripts, use JSON or dotenv output and explicitly pass the resulting file to downstream jobs.
Normalization
GitVersion can normalize repository references when a build server is detected. The --no-normalize option disables that step; it does not supply missing references. Follow provider-specific checkout guidance before changing this behavior.