{"id":13408930,"url":"https://github.com/github/renaming","last_synced_at":"2025-09-29T02:32:31.796Z","repository":{"id":38281819,"uuid":"271896287","full_name":"github/renaming","owner":"github","description":"Guidance for changing the default branch name for GitHub repositories","archived":true,"fork":false,"pushed_at":"2022-03-18T00:40:56.000Z","size":131,"stargazers_count":2411,"open_issues_count":0,"forks_count":192,"subscribers_count":229,"default_branch":"main","last_synced_at":"2025-01-11T06:31:29.158Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/github.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-12T21:51:22.000Z","updated_at":"2025-01-08T05:03:45.000Z","dependencies_parsed_at":"2022-08-18T19:21:01.028Z","dependency_job_id":null,"html_url":"https://github.com/github/renaming","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Frenaming","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Frenaming/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Frenaming/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Frenaming/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/github","download_url":"https://codeload.github.com/github/renaming/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234583683,"owners_count":18856280,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T20:00:56.681Z","updated_at":"2025-09-29T02:32:26.505Z","avatar_url":"https://github.com/github.png","language":null,"readme":"# Renaming the default branch from `master`\n\nMany communities, both on GitHub and in the wider Git community, are considering renaming the default branch name of their repository from `master`. GitHub is gradually renaming the default branch of our own repositories from `master` to `main`. 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.\n\nWe're not the only organization in the Git ecosystem making these changes: there are upcoming changes in the Git project ([statement](https://sfconservancy.org/news/2020/jun/23/gitbranchname/), [code change](https://lore.kernel.org/git/pull.656.v4.git.1593009996.gitgitgadget@gmail.com/)), as well as coordinated changes from multiple vendors.\n\nWe're making changes to GitHub in a few phases, designed to cause as little disruption to existing projects as possible.\n\n## What's already changed\n\n- [We've updated GitHub.com](https://github.blog/changelog/2020-07-17-links-to-deleted-branches-now-redirect-to-the-default-branch/) to redirect links that contain the deleted branch name such as `master` to the corresponding link in the repository's new default branch.\n- [We've updated GitHub Pages](https://github.blog/changelog/2020-07-31-build-and-deploy-github-pages-from-any-branch-beta/) to build and deploy from any branch.\n  - Note: publishing to the special `gh-pages` branch will still work the same as it always has, but now you can choose any other branch in your repository as the publishing source.\n  - Note: If the branch used by GitHub Pages is renamed, your GitHub Pages site will be unpublished. Pushing a new commit to the renamed branch will republish the site.\n- [We've added user, organization, and enterprise settings](https://github.blog/changelog/2020-08-26-set-the-default-branch-for-newly-created-repositories/) to set the default branch name for all newly-created repositories on GitHub.com. We're adding the same settings in the 3.0 release of GitHub Enterprise Server.\n  - These settings cover repositories created through [GitHub.com](https://github.com/new) and the [GitHub API](https://developer.github.com/v3/guides/getting-started/#create-a-repository). Git 2.28 added a similar setting to control the default branch used when you run `git init` on the command line. Learn more about the new `init.defaultBranch` setting in [the Git 2.28 blog post](https://github.blog/2020-07-27-highlights-from-git-2-28/#introducing-init-defaultbranch).\n  - [GitHub Desktop](https://desktop.github.com/) has introduced a default branch setting for new repositories.\n- [We've made it easier to rename an existing branch](#rename-existing)\n- [We've updated Gists to use your preferred branch name](https://github.blog/changelog/2022-02-10-gists-now-support-alternative-default-branch-names/)\n \n## New repositories use `main` as the default branch name\n\nThe default branch name for new repositories created on GitHub is now `main`. To set a different default:\n\n1. For [users](https://docs.github.com/en/github/setting-up-and-managing-your-github-user-account/managing-the-default-branch-name-for-your-repositories), on the https://github.com/settings/repositories page\n2. For [organization owners](https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/managing-the-default-branch-name-for-repositories-in-your-organization), on the `https://github.com/organizations/YOUR-ORGANIZATION/settings/repository-defaults` page\n3. For [enterprise administrators](https://docs.github.com/en/github/setting-up-and-managing-your-enterprise-account/enforcing-repository-management-policies-in-your-enterprise-account#enforcing-a-policy-on-the-default-branch-name), on the `https://github.com/enterprises/YOUR-ENTERPRISE/settings/member_privileges` page\n\nUsers, 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.\n\n### Why main?\n\n`main` is the most popular replacement for `master` 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 using `main` for our newly-created repositories and for the repositories we're moving now, like [dependabot-core](https://github.com/dependabot/dependabot-core).\n\n\u003ca name=\"rename-existing\"\u003e\u003c/a\u003e\n\n## Renaming existing branches\n\nYou can now rename any branch, including the default branch, from the web.\n\n![Rename default branch dialog](rename-default-branch-dialog.png)\n\nRenaming a branch will:\n\n- Re-target any open pull requests\n- Update any draft releases based on the branch\n- Move any branch protection rules that explicitly reference the old name\n- Update the branch used to build GitHub Pages, if applicable\n- Show a notice to repository contributors, maintainers, and admins on the repository homepage with instructions to update local copies of the repository\n- Show a notice to contributors who `git push` to the old branch\n- Redirect web requests for the old branch name to the new branch name\n- Return a \"Moved Permanently\" response in API requests for the old branch name\n\nLearn more about [renaming a branch](https://docs.github.com/github/administering-a-repository/renaming-a-branch).\n","funding_links":[],"categories":["Use of Master/Slave and Other Terms","Others"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub%2Frenaming","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgithub%2Frenaming","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub%2Frenaming/lists"}