I’ve got a new computer, and I installed Git on it. Then I decided I had to upgrade Git on my other computer, which had version 2.14. There have been a lot of significant changes with version 2.32.
One of these changes got me to thinking about something I’ve taken for granted for a few years: the name of the default branch in a repository.
For almost as long as I’ve been using Git and GitHub, and long before, the default branch of a repository is called “master.” I never thought I would want to change that branch name.
In recent years, there has been talk that the branch name “master” is problematic because of the suggestion of the master-slave relationship. Both “master” and “slave” are used in some contexts in computer science.
That wasn’t the original intent for Git and GitHub, which use the term “master” but not the term “slave.” Still, that association affects the perception of Git and GitHub.
If there is a way that I can change the principal branch name of my Git repositories to something that won’t offend anyone, I should make that change.
I have some privilege which does shield me from considerations like this. Frankly, if it hadn’t been for going through the Git installation on one computer and an upgrade on another, I might not have given this issue any more thought.
Depending on the options you choose when installing Git or upgrading to the latest version, Git will make new repositories with a default branch name that you specify during the installation or upgrade.
The Git installer suggests names like “trunk” for the principal branch, and also that many teams have already made the change away from “master.” So I chose “main.” Easy enough.
Note that your older repositories won’t be changed unless you consciously make that change for each of them. That might be a little difficult.
Changing the default branch name on a repository to something more “inclusive” like “main,” “base” or “default” won’t resolve any of the social injustices of our world.
#branch-naming #git #repositories #github