Skip to content

[ISSUE]: Semver doesn't include prerelease tags in Git Tag #4384

@agocke

Description

@agocke

Prerequisites

  • I have written a descriptive issue title
  • I have searched issues to ensure it has not already been reported

GitVersion package

GitVersion.Tool

GitVersion version

6.1.0

Operating system

macOS

What are you seeing?

{
  "AssemblySemFileVer": "0.7.4.0",
  "AssemblySemVer": "0.7.4.0",
  "BranchName": "(no branch)",
  "BuildMetaData": 4,
  "CommitDate": "2025-01-20",
  "CommitsSinceVersionSource": 4,
  "EscapedBranchName": "-no-branch-",
  "FullBuildMetaData": "4.Branch.-no-branch-.Sha.a34a1af4aa6ef6fc971fcabbef994e909c2616b9",
  "FullSemVer": "0.7.4--no-branch-.1+4",
  "InformationalVersion": "0.7.4--no-branch-.1+4.Branch.-no-branch-.Sha.a34a1af4aa6ef6fc971fcabbef994e909c2616b9",
  "Major": 0,
  "MajorMinorPatch": "0.7.4",
  "Minor": 7,
  "Patch": 4,
  "PreReleaseLabel": "-no-branch-",
  "PreReleaseLabelWithDash": "--no-branch-",
  "PreReleaseNumber": 1,
  "PreReleaseTag": "-no-branch-.1",
  "PreReleaseTagWithDash": "--no-branch-.1",
  "SemVer": "0.7.4--no-branch-.1",
  "Sha": "a34a1af4aa6ef6fc971fcabbef994e909c2616b9",
  "ShortSha": "a34a1af",
  "UncommittedChanges": 1,
  "VersionSourceSha": "e2d7a2e1cb71ef64bcdcb483ec125239b3961d2c",
  "WeightedPreReleaseNumber": 1
}

What is expected?

I'm running the default config and have a tag called "v0.7.4-preview.1". I would expect that the detected semver for this tag would be "0.7.4-preview.1", but the results are instead the above.

Steps to Reproduce

Create a repository with a tag v0.7.4-preview.1 and checkout that tag. Run dotnet gitversion.

RepositoryFixture Test

No response

Output log or link to your CI build (if appropriate).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions