A2oz

How to Make Master Branch Default in GitHub?

Published in GitHub 1 min read

You cannot directly make the master branch the default in GitHub. The default branch is set at the repository level and is typically named main.

However, you can change the default branch name to master if you wish. Here's how:

  1. Navigate to your repository: Go to your GitHub repository page.
  2. Click on "Settings": Find the "Settings" tab and click on it.
  3. Select "Branches": In the left sidebar, choose "Branches."
  4. Change "Default branch": Find the "Default branch" setting and select master from the dropdown menu.
  5. Click "Save changes": Confirm your changes by clicking the "Save changes" button.

This will make master the default branch for your repository. Remember that changing the default branch name might affect your workflow and might require updating any scripts or configurations that rely on the previous default branch name.

Related Articles