Inclusive git: rename “master” to “main” + change default

Take 5 minutes to make your company a little more inclusive! You may want to rename the master branch to main:

git branch -m master main
git push -u origin main

Then you may want to delete the master branch at your git host (e.g. github).

Change default name master to main

The make git init create a main branch by default (instead of master) you can do it starting from git v 2.28 like so:

git config --global init.defaultBranch main

This entry was posted in Software Engineering, Stuff. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *