截至本周,我注意到,在 azure devops 中创建新存储库时,“master”分支不再存在,而是被“main”分支取代。
当我为新存储库配置管道时,我使用 GitVersion 任务,我一直用该任务在 azure devops 中对我的工件进行版本控制,但自从进行此更改后,我收到以下错误:
System.InvalidOperationException: Could not find a 'develop' or 'master' branch, neither locally nor remotely.
有人知道我该如何解决这个问题吗?
非常感谢您的支持。
最佳答案
是的,git 生态系统中的许多工具或服务正在不再将“master”作为默认分支: https://devblogs.microsoft.com/devops/azure-repos-default-branch-name/
实际上没有 GitVersion 版本支持这个新分支名称。
参见https://github.com/GitTools/GitVersion/issues/2433
有修复https://github.com/GitTools/GitVersion/pull/2367
所以你有两种可能性:
切换回“master”分支(请参阅上面第一个链接中在 Azure Devops 中设置的设置),您必须自己重命名该分支。
在等待修复版本发布时更新 GitVersion 配置。请参阅https://github.com/GitTools/GitVersion/issues/2433#issuecomment-725586659
关于git - Azure devops GitVersion 任务失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65132584/