Skip to content

Rename default branch from master to main #633

Description

@justwheel

Summary

Rename the default branch from master to main.

Background

The term "master" in the context of default branch naming carries connotations rooted in master/slave terminology, which is exclusionary and harmful to members of communities that have been historically affected by slavery. The Git project, GitHub, the Fedora Project, and many major open source projects have adopted main as the default branch name to foster a more welcoming and inclusive environment. As a program dedicated to inclusion in open source, Outreachy's own repository should reflect this value.

Details

GitHub provides a straightforward process to rename the default branch:

  1. Go to Settings > General > Default branch on the repository page
  2. Click the edit (pencil) icon next to master
  3. Type main and click Rename branch

GitHub will automatically:

  • Retarget any open pull requests to the new branch name
  • Update branch protection rules
  • Create a redirect so that any links or clones referencing master will resolve to main

Contributors with existing local clones can update with:

git branch -m master main
git fetch origin
git branch -u origin/main main
git remote set-head origin -a

Any CI/CD configuration, documentation, or scripts that reference master should be updated to reference main after the rename.

Outcome

The repository will use main as its default branch name, aligning with industry standards and reinforcing Outreachy's commitment to inclusive language in open source.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions