Skip to content

chore: Rename default branch from master to main #52

@lykinsbd

Description

@lykinsbd

Problem

The default branch is named master, which does not match modern conventions. GitHub now defaults to main for new repositories, and most Go projects and tooling expect main.

Steps

  1. Rename the branch on GitHub: Settings → Branches → Rename master to main
  2. Update local checkouts: git branch -m master main && git fetch origin && git branch -u origin/main main
  3. Update hardcoded references in the repo:
    • .github/workflows/test.yml: git-token: ${{ github.ref_name == 'master' && ... }}main
    • README.md: badge URL ...badges/.badges/master/coverage.svg...badges/.badges/main/coverage.svg
    • .goreleaser.yml: verify no hardcoded branch references
  4. Rename the badge path on the badges branch: move .badges/master/.badges/main/
  5. Update the fgrosse/go-coverage-report baseline lookup — it searches for artifacts from the master branch push workflow; this will update automatically once the branch is renamed

Notes

GitHub will automatically redirect mastermain for existing clone URLs, so existing users will not be broken immediately. The redirect is not permanent — users should update their remotes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions