Summary
This repository used master as the default branch. We migrated the default branch to main without breaking CI, GitHub Pages, the hosted setup.sh entrypoint, or active pull requests.
Why this mattered
- The repository default branch was still
master.
- GitHub Pages published from
master:/.
- Several repository-managed references still assumed
master.
- Open pull requests targeted
master.
- We wanted to complete the migration in a controlled order and delete
master after verification.
Current known references that were updated
README.md
.github/workflows/macos.yaml
.github/workflows/ubuntu.yaml
.github/workflows/test.yaml
setup.sh
home/dot_local/bin/exact_common/executable_chezmoi-notify-cache
tests/install/common/chezmoi_notify_cache.bats
Plan
Migration guide for existing machines still on master
Run this on each existing machine after main exists remotely and before relying on chezmoi update again.
cd "$(chezmoi source-path)"
git status --short --branch
# If the worktree is dirty, commit or stash changes before continuing.
git fetch origin --prune
git branch -m master main
git branch --set-upstream-to=origin/main main
git remote set-head origin -a
chezmoi update
If git branch -m master main fails because main already exists locally, switch to main, rebind it to origin/main, and then run chezmoi update.
This guide is necessary because chezmoi update uses git pull --autostash --rebase; machines left on local master will break once origin/master is removed.
Acceptance criteria
Notes
- All Git/GitHub write operations were performed from fresh task-specific worktrees because the source worktree was dirty.
bats validation was done through GitHub Actions CI, not locally.
- Remaining
master strings on origin/main are only external upstream URLs or comments, not repository-owned branch/config references.
Summary
This repository used
masteras the default branch. We migrated the default branch tomainwithout breaking CI, GitHub Pages, the hostedsetup.shentrypoint, or active pull requests.Why this mattered
master.master:/.master.master.masterafter verification.Current known references that were updated
README.md.github/workflows/macos.yaml.github/workflows/ubuntu.yaml.github/workflows/test.yamlsetup.shhome/dot_local/bin/exact_common/executable_chezmoi-notify-cachetests/install/common/chezmoi_notify_cache.batsPlan
mainfrom the currentmastertip.masterthat updates repository-managedmasterreferences.masterandmainin workflow branch filters so CI still runs before the cutover.README.mdlinks frommastertomain.setup.shso the fallback branch ismain.origin/mastertoorigin/main.branch/main.mainto the merged prep commit if needed.mastertomain.master:/tomain:/.#427and#270tomain.~DEFAULT_BRANCH.mainto remove temporary dual-branch workflow support.mainonly.refs/heads/mainonly.main.masterafter the migration is verified.Migration guide for existing machines still on
masterRun this on each existing machine after
mainexists remotely and before relying onchezmoi updateagain.If
git branch -m master mainfails becausemainalready exists locally, switch tomain, rebind it toorigin/main, and then runchezmoi update.This guide is necessary because
chezmoi updateusesgit pull --autostash --rebase; machines left on localmasterwill break onceorigin/masteris removed.Acceptance criteria
gh repo viewreportsmainas the default branch.main:/.main.main.setup.shstill works after the Pages rebuild.master.masteris deleted after verification.Notes
batsvalidation was done through GitHub Actions CI, not locally.masterstrings onorigin/mainare only external upstream URLs or comments, not repository-owned branch/config references.