Renaming the default branch of our own repositories from master to main.
gem install github-renaming
github-renaming default-branch <old-branch> <new-branch> -t <token> -r <user/repo>
Rename master to main
github-renaming default-branch master main -t <token> -r <user/repo>
The gem is available as open source under the terms of the MIT License.