To change the default branch in a GitHub repository

To change the default branch in a GitHub repository, you need admin access and at least two branches in the repo. docs.github

Via Web Interface

  1. Open your repository on GitHub.com (e.g., github.com/username/repo-name). docs.github
  2. Click the Settings tab under the repo name (use the dropdown if not visible). docs.github
  3. In the left sidebar, find Branches > Default branch. docs.github
  4. Click the pencil icon or dropdown next to the current default branch name. docs.github
  5. Select your new default branch (e.g., main) from the list. docs.github
  6. Click Update and confirm by selecting I understand, update the default branch. docs.github

This updates where new PRs and clones point by default. docs.github

Via GitHub CLI (Optional)

In your repo’s local directory:

gh repo edit --default-branch main

(Replace main with your target branch; it must exist first). stackoverflow

Let me know your setup (web-only, CLI, etc.) for more tailored steps.