在 AzureDevops 上运行 GitVersion,当尝试在除主分支以外的任何分支上(包括拉取请求分支等)使用时,出现以下错误消息;
目前我已尝试通过以下方式解决此问题:
- 增加检出深度
- 手动指定下一个版本号
错误信息:
Gitversion could not determine which branch to treat as the development branch
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: []
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