3025 shaares
For the longest time, the default branch in most Git repositories was named "master". Fortunately, many people have become aware that this terminology (even more evident in "master/slave") should be replaced! The tech industry should move to a more inclusive, open culture - and removing language like "master/slave" is an important step in this journey.
In the public discussion, a handful of different alternatives for "master" have popped up, "default" and "primary" being some of them. But the most popular term seems to be "main".
This short article will help you rename "master" in your own Git repositories to "main" (or any other term your team has chosen).
git branch -m master main
git push -u origin main
git push origin --delete master
Teammates:
git checkout master
git branch -m master main
git fetch
git branch --unset-upstream
git branch -u origin/main