Describe the bug
A newly created github repo now uses 'main' instead of 'master' as the default branch. Attempting to run gitversion against this results in.
System.InvalidOperationException: Could not find a 'develop' or 'master' branch, neither locally nor remotely.
I believe the default behavior should be extedned to include 'main' also.
Other command such as /init also fail
A 'main' branch should be treated the same as a 'master' branch with default configuration.
There is no default handling for a main branch and the lack of master or develop causes an error to be returned.
I expect I will need to create a GitVersion.yml and setup main branch handling until this is supported. Alternatively I could rename my branch to master.
main, but it has unfortunately not been released yet. We'll be sure to get a release out the door soon.@chr15murray - would be useful if you could edit the title of the issue.
Any possible workarounds while we wait for the release?
@atrauzzi you should be able to setup the configuration file similar to the following:
https://github.com/Jericho/ZoomNet/blob/develop/GitVersion.yml
Where that repository has already made the switch to using main
@atrauzzi, #2367 should have been included in the 5.5.0 release that went out the door 16 days ago. Does it now work?
@asbjornu - Don't want to hijack this thread, but I'm trying to take advantage of the latest version to resolve the issue in this thread but I'm using Azure pipeline task GitVersion@5 and it seems like it's always only installing 5.0.1?
Are there steps to get 5.5.0 supported in Azure Pipelines so that I can take advantage of the latest version changes?
steps:
- task: GitVersion@5
inputs:
runtime: 'core'
configFilePath: 'GitVersion.yml'
updateAssemblyInfo: true
Output in pipeline:
Task : GitVersion Task
Description : Easy Semantic Versioning (http://semver.org) for projects using Git
Version : 5.0.1
Author : GitVersion Contributors
@jeanfrancoislarente GitVersion task is obsolete, please consider moving to https://marketplace.visualstudio.com/items?itemName=gittools.gittools. Here is a sample on
how to use it https://github.com/GitTools/actions/blob/master/docs/examples/azure/gitversion/index.md
Thanks for the prompt response @arturcic - moved over now. Issue with updateAssemblyFileInfo but I'll dig into that and/or create a separate issue once I'm done testing the switch to main branch!
I think the GitHub action for gitversion might need to be updated.
I'm still receiving this error with only a 'main' branch in version 5.5.1.
(also, seems like the error message will need to be updated too)
(also, seems like the error message will need to be updated too)
Indeed. Pull requests are welcome! 馃檹
Most helpful comment
2367 added support for
main, but it has unfortunately not been released yet. We'll be sure to get a release out the door soon.