Renaming Default Branch from master to main¶
Status¶
Completed - Local branches have been renamed and pushed. GitHub default branch settings updated.
What Was Done¶
- ✅ Renamed local branch:
git branch -m master main - ✅ Pushed new main branch:
git push -u origin main - ✅ Completed for both repositories:
cluster-gitopscamarades-infrastructure
Manual Steps Required on GitHub¶
For cluster-gitops repository:¶
- Go to: https://github.com/camaradesuk/cluster-gitops/settings/branches
- Under "Default branch", click the switch icon (↔️) next to "master"
- Select "main" from the dropdown
- Click "Update"
- Confirm the change
For camarades-infrastructure repository:¶
- Go to: https://github.com/camaradesuk/camarades-infrastructure/settings/branches
- Under "Default branch", click the switch icon (↔️) next to "master"
- Select "main" from the dropdown
- Click "Update"
- Confirm the change
After Changing Default Branch¶
Delete the old master branch from both repositories:
# For cluster-gitops
cd /home/chris/workspace/syrf/cluster-gitops
git push origin --delete master
# For camarades-infrastructure
cd /home/chris/workspace/syrf/camarades-infrastructure
git push origin --delete master
ArgoCD Impact¶
ArgoCD ApplicationSets are already configured to use main branch:
- targetRevision: main in all ApplicationSets
- No changes needed to ArgoCD configuration
Once the default branch is changed on GitHub, ArgoCD will automatically:
1. Resolve main branch correctly
2. Start generating Applications from ApplicationSets
3. Deploy infrastructure and SyRF services
Verification¶
After completing GitHub changes, verify ArgoCD can resolve the branch:
# Trigger hard refresh of root Application
kubectl annotate application root -n argocd argocd.argoproj.io/refresh=hard --overwrite
# Wait 15 seconds and check ApplicationSet controller logs
sleep 15
kubectl logs -n argocd deployment/argocd-applicationset-controller --tail=20
# Should see successful generation, not "unable to resolve 'main'"
Other Repositories¶
The main syrf monorepo also uses master. You may want to rename it too: