Skip to content

Support for renaming an existing branch

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

Branch rename dialog

If you've been waiting to rename your default branch from master to main, we now recommend doing so using this feature.

When a branch is renamed:

  • Open pull requests and draft releases targeting the renamed branch will be retargeted automatically
  • Branch protection rules that explicitly reference the renamed branch will be updated

Note: admin permissions are required to rename the default branch, but write permissions are sufficient to rename other branches.

To help make the change as seamless as possible for users:

  • We'll show a notice to contributors, maintainers, and admins on the repository homepage with instructions for updating their local repository
  • Web requests to the old branch will be redirected
  • A "moved permanently" HTTP response will be returned to REST API calls
  • An informational message will be displayed to Git command line users that push to the old branch

This change is one of many changes GitHub is making to support projects and maintainers that want to rename their default branch. Branch names will not change unless the maintainer explicitly makes the change, however this new rename functionality should dramatically reduce the disruption to projects who do want to change branch names. To learn more about the change we've made, see github/renaming.

To learn more, see Renaming a branch

The first GitHub Enterprise Server 3.0 Release Candidate is now available for download.

Enterprise Server 3.0 is our biggest ever Server release. It brings an extensive set of new features to companies on GitHub Enterprise Server, enabling any company to manage DevOps and security with a set of developer-first tools that make automation, CI, CD and code security part of your existing workflows.

Features include:

  • Actions (GA) – developer-first workflow automation and CI/CD
  • Packages (GA) – packages hosted next to your code
  • Mobile Apps (Beta) – work from the living room or coffee shop, with iOS and Android apps

For companies interested in automating code security with GitHub Advanced Security, we’re also bringing:

  • Code scanning (GA) – scan every pull request for known vulnerabilities with CodeQL
  • Secret scanning (Beta) – detect credentials in code before they hit production

We've also containerised GitHub Enterprise Server, paving the path to a more modern and flexible way to administer GitHub.

Read the full release notes or download the release candidate today. Release Candidates are pre-release builds, which should be installed on test or staging environments. GitHub Support are here to help with any issue found in a release candidate, and we're looking forward to hearing your feedback.

See more