Github
GitHub is a code hosting and version control platform for developers to collaborate on software projects.
Website
Industry
Website
Share this article:

How to change the default branch of a GitHub repository

Here is how to change the default branch of a github repository

  1. First, open the repository where you want to change the default branch
  2. Next click on "Settings" tab in the top navigation menu
  3. Scroll down to the "Default branch" section
  4. Then click on the update icon button next to the default branch name
  5. In the modal dialog, click on the branch dropdown
  6. Then select the branch you want to set as the new default
  7. Click on "Update" button in the branch selection modal
  8. Finally click on "I understand, update the default branch" confirmation button in the dialog

Create your own interactive guide with Guideflow

Why should you change the default branch of a GitHub repository

GitHub is a powerful platform that enables efficient collaboration and version control for software development projects.

Changing the default branch of a GitHub repository is a flexible feature that empowers project managers and developers to steer team focus towards the most current and relevant codebase.

This feature enhances workflow agility, ensuring that ongoing development aligns with evolving project goals without disrupting contributors or the integration process.

Ultimately, it supports a more organized, streamlined project management experience.

Last update
March 31, 2026
Cursor MariaA cursor points to a button labeled "James."

Create your first demo in less than 30 seconds.