add main to the master branch regex in the default configuration #2367
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As many more organizations (including GitHub) and repositories are moving towards naming their default branch
main
instead ofmaster
, it would be useful to include this naming in the default configuration.Description
Change the default regex for master branches from
^master$
to^master|main$
.Related Issue
Fixes #2366.
Motivation and Context
Our organization is making this change and many of our repos use GitVersion. We could make custom configurations for all these repositories, but that is yet another configuration file to maintain and distribute. As this is a movement that is gaining popularity across the board, it would be useful to have this baked into GitVersion and not require a custom configuration.
main
seems to be the general consensus from the community as the preferred alternative tomaster
. It also seems to be the preferred name of the developer who chose the original names.How Has This Been Tested?
I attempted to test this locally but was unable to figure out how to build the project. I attempted to build it in a docker image but my changes were not there. I would appreciate help on this.I wasn't able to package it locally still, but I was able to get the project working and ran the tests that were breaking in GitHub. Much easier than making a commit to test.
Screenshots (if appropriate):
Checklist: