Skip to content

[ISSUE]: Unreplaced string "{BranchName}" observed in gitversion json output. #4652

@scott-wi

Description

@scott-wi

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.4

Operating system

Windows

What are you seeing?

Getting non-parameterized variable names in version output (ie, "{BranchName}" appears in several output vars).

What is expected?

string literal "{BranchName}" not to appear in variable output; instead a substituted branch name from Git

Steps to Reproduce

Seems to be happening when a branch is specified with mode: ContinuousDelivery

This same setup seems to cause a failure when running from an Azure DevOps pipeline under Linux

Below is the GitVersion.yaml I'm referencing:

mode: ContinuousDeployment
branches:
  develop:
    regex: ^dev(elop)?(ment)?$
    mode: ContinuousDeployment
  master:
    regex: ^master$|^main$
    mode: ContinuousDelivery
    label:
    increment: Patch
    prevent-increment:
      of-merged-branch: true
    track-merge-target: false
  features:
    regex: ^features?[/-]
    mode: ContinuousDelivery
  hotfix:
    regex: ^hotfix(es)?[/-]
    mode: ContinuousDelivery
  release:
    regex: ^release(es)?[/-]
    mode: ContinuousDelivery
  codespike:
    regex: ^codespike[/-]
    mode: ContinuousDelivery

RepositoryFixture Test

No response

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

{
  "AssemblySemFileVer": "1.293.0.0",
  "AssemblySemVer": "1.293.0.0",
  "BranchName": "codespike/pipeline-work",
  "BuildMetaData": null,
  "CommitDate": "2025-08-11",
  "CommitsSinceVersionSource": 90,
  "EscapedBranchName": "codespike-pipeline-work",
  "FullBuildMetaData": "Branch.codespike-pipeline-work.Sha.82a3bbfd5eb1bd1c0074c4d50749f94ade2578b6",
  "FullSemVer": "1.293.0-{BranchName}.90",
  "InformationalVersion": "1.293.0-{BranchName}.90+Branch.codespike-pipeline-work.Sha.82a3bbfd5eb1bd1c0074c4d50749f94ade2578b6",
  "Major": 1,
  "MajorMinorPatch": "1.293.0",
  "Minor": 293,
  "Patch": 0,
  "PreReleaseLabel": "{BranchName}",
  "PreReleaseLabelWithDash": "-{BranchName}",
  "PreReleaseNumber": 90,
  "PreReleaseTag": "{BranchName}.90",
  "PreReleaseTagWithDash": "-{BranchName}.90",
  "SemVer": "1.293.0-{BranchName}.90",
  "Sha": "82a3bbfd5eb1bd1c0074c4d50749f94ade2578b6",
  "ShortSha": "82a3bbf",
  "UncommittedChanges": 5,
  "VersionSourceSha": "25f35f755d6022bad360b6097df75c267c10cf83",
  "WeightedPreReleaseNumber": 90
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions