Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Sep 12, 2023. It is now read-only.
/renamingPublic archive

Guidance for changing the default branch name for GitHub repositories

License

NotificationsYou must be signed in to change notification settings

github/renaming

Many communities, both on GitHub and in the wider Git community, are considering renaming the default branch name of their repository frommaster. GitHub is gradually renaming the default branch of our own repositories frommaster tomain. We're committed to making the renaming process as seamless as possible for project maintainers and all of their contributors. This repository is our up-to-date guidance on how and when to rename your default branch.

We're not the only organization in the Git ecosystem making these changes: there are upcoming changes in the Git project (statement,code change), as well as coordinated changes from multiple vendors.

We're making changes to GitHub in a few phases, designed to cause as little disruption to existing projects as possible.

What's already changed

New repositories usemain as the default branch name

The default branch name for new repositories created on GitHub is nowmain. To set a different default:

  1. Forusers, on thehttps://github.com/settings/repositories page
  2. Fororganization owners, on thehttps://github.com/organizations/YOUR-ORGANIZATION/settings/repository-defaults page
  3. Forenterprise administrators, on thehttps://github.com/enterprises/YOUR-ENTERPRISE/settings/member_privileges page

Users, organizations, and enterprises that previously selected a default branch for new repositories are not impacted by this change. Existing repositories are also not impacted by this change.

Why main?

main is the most popular replacement formaster that we're seeing across GitHub. We like it because it's short, it keeps your muscle memory intact, and it translates well across most languages. We're usingmain for our newly-created repositories and for the repositories we're moving now, likedependabot-core.

Renaming existing branches

You can now rename any branch, including the default branch, from the web.

Rename default branch dialog

Renaming a branch will:

  • Re-target any open pull requests
  • Update any draft releases based on the branch
  • Move any branch protection rules that explicitly reference the old name
  • Update the branch used to build GitHub Pages, if applicable
  • Show a notice to repository contributors, maintainers, and admins on the repository homepage with instructions to update local copies of the repository
  • Show a notice to contributors whogit push to the old branch
  • Redirect web requests for the old branch name to the new branch name
  • Return a "Moved Permanently" response in API requests for the old branch name

Learn more aboutrenaming a branch.

About

Guidance for changing the default branch name for GitHub repositories

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks


[8]ページ先頭

©2009-2025 Movatter.jp