Dethrone "main" and restore "master" to its rightful glory.
A script that unwoke'ifies the default branch by renaming it from "main" to "master".
- Nix with flakes enabled
- (Or, run
script.shdirectly)
- (Or, run
- GitHub CLI (
gh) authenticated with appropriate permissions- Run
nix run nixpkgs#gh auth login
- Run
nix run github:srid/master -- <repo-url>The script will:
- Check if the repository's default branch is "main"
- If not, exit (nothing to do)
- If yes, clone the repository
- Rename the branch from "main" to "master"
- Push the new branch
- Update the repository's default branch setting
- Delete the old one
nix run github:srid/master -- https://github.com/yourname/yourrepoSee LICENSE file for details.