I have just renamed librsvg's master branch to main, as other
modules already have.

This is what I did:
- Rename the local branch, and push it:
git branch -m master main
git push origin main
-
Change the default branch in gitlab; for librsvg this is in the repository settings / Default branch - change that to
main. -
Set the same protection for the
mainbranch as there was formaster, if any - repository settings / Protected branches -> create a new protection and copy the settings frommaster. -
Unprotect the
masterbranch so I can delete it - repository settings / Protected branches -> unprotect themasterbranch. -
Delete the
masterbranch in the branches list. -
Update the CI and build scripts: for librsvg it was just
.gitlab-ci.yml. -
Update your documentation: for librsvg it was just
COMPILING.md. -
Notify the release team; I created an issue and one for gnome-build-meta.
Update 2021/Sep/30: Extra things which Philip Withnall suggested:
-
Notify
gnome-i18n@gnome.orgso they can update the damned-lies software. (Librsvg has no translations). -
See if any project have a
librsvg.wrap(for Meson?) and notify them. I don't think I'm using search engines correctly... -
Re-protect the
masterbranch to prevent people accidentally pushing to it. Since that branch no longer exists, gitlab lets you create a protection by glob matching on a name, not an actual branch.
Update 2022/Jul/06: Some extra configuration to update:
- If your project has gitlab badges, verify that they point to the
mainbranch in settings/general/badges. You can use%{default_branch}as part of the badge URLs to avoid hardcoding names.
If you have a local checkout, you can do this:
# update from upstream
git fetch origin
# switch to your local master branch
git checkout master
# rename your local branch
git branch -m master main
# Remove the old upstream...
git branch --unset-upstream
# ... and set the new one
git branch -u origin/main
That's all!