通过 AzureDevops 运行 GitVersion,并在尝试在除 master 之外的任何分支(包括拉取请求分支等)上使用时收到以下错误消息;
到目前为止,我已尝试通过以下方式解决该问题:
错误:
Gitversion could not determine which branch to treat as the development branch
Run Code Online (Sandbox Code Playgroud)
Git版本文件
mode: Mainline
branches:
master:
regex: master
increment: Patch
assembly-informational-format: '{MajorMinorPatch}+Branch.{BranchName}{PreReleaseTag}'
major-version-bump-message: '\+semver:\s?(breaking|major)'
minor-version-bump-message: '\+semver:\s?(feature|minor)'
patch-version-bump-message: '\+semver:\s?(fix|patch)'
commit-message-incrementing: Enabled
tag-prefix: '[vV]'
ignore:
sha: []
Run Code Online (Sandbox Code Playgroud)
YAML 管道
- task: gitversion/setup@0
displayName: gitversion/setup
inputs:
versionSpec: '5.10.3'
- task: gitversion/execute@0
displayName: gitversion/execute
inputs:
useConfigFile: true
configFilePath: GitVersion.yml
Run Code Online (Sandbox Code Playgroud)