DEV Community

Changing the default branch name on GitHub

Nočnica Mellifera on July 23, 2020

While the tech industry struggles to address injustice in our society, a small step you can take today is to remove the use of "Master/Slave" termi...
ben profile image
Ben Halpern

This is a highly disingenuous comment Bohdan.

linaran profile image

Too aggressive on his part and the original issue is beyond politics, I agree.

But there is a point in there. Git certainly isn't the only thing using the master/slave terminology. There's a lot of refactoring (perhaps total rebuilding) to be done worldwide if we want to be consistent about this.

Btw, for transparency purposes stackoverflow clearly shows the number of downvotes on answers that were non-constructive. As far as I can tell the invisible hand of the "community" faded away that comment, although that comment has above average hearts.

Thread Thread
stephenrjohnson profile image
LimaBean Consulting

While it may be poorly worded, the fact that is has nearly double the amount of hearts would suggest that it is a shared sentiment.

rozbarnes profile image
Roz Barnes

Thanks so much! I'm new to coding, but those terms have made me feel icky. Thank you, thank you!

memitaru profile image
Ami Scott (they/them)

Thanks for this! I actually forgot you can change the default branch on github 😅😅

jcolag profile image
John Colagioia (he/him)

Very nice! I've been going through my repositories updating them (I'll probably post something about it on Wednesday or Thursday, myself), but something that hadn't occurred to me was deleting the original branch.

nocnica profile image
Nočnica Mellifera

Awesome! I look forward to reading it.

michaeltharrington profile image
Michael Tharrington

I hope the workshop goes well today @nočnica! This is definitely an important topic.

modestfake profile image
Vitalii Saienko

With the latest git version 2.28 you can set the default branch name globally with this command:

git config --global init.defaultBranch main

Git v2.28 highlights

nocnica profile image
Nočnica Mellifera

Thank you! I need to update this post :)

raynoldshelen profile image
Helen Raynolds

How do you add the git function to git itself so that it's run whenever we init a repo?

nocnica profile image
Nočnica Mellifera

I do not think there’s a good way to do that, though anyone who clones a repository so initiated will have the same branch naming scheme.

Thankfully GitHub is looking at changing default naming soon :)

hybriscole profile image
Alberto Cole❌

late capitalism problems™

Some comments have been hidden by the post's author - find out more