Skip to content

Rename default branch to main #15219

@dingmeng-xue

Description

@dingmeng-xue

Many communities, both on GitHub and in the wider Git community, are considering renaming the default branch name of their repository from master. Azure PowerShell team plans to rename the default branch of repository https://github.com/Azure/azure-powershell and https://github.com/Azure/azure-powershell-pr to main on June 10

What will be done automatically during the renaming process.

  1. Existing PRs targeted master branch will be targeted main branch
  2. Branch protection rule will be migrated from master branch to main branch

What need to be done manually

  1. Update the name of the default branch of cloned the repository on your computer
git branch -m master main
git fetch origin 
git branch -u origin/main main
  1. New PRs should be created against main branch instead of master branch
  2. Rename default branch to main on your forked repo. https://docs.github.com/en/github/administering-a-repository/managing-branches-in-your-repository/renaming-a-branch#renaming-a-branch

Guidance from Github for your reference https://github.com/github/renaming

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions