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...
Collapse
 
ben profile image
Ben Halpern

This is a highly disingenuous comment Bohdan.

Collapse
 
linaran profile image
Deni

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.

Collapse
 
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!

Collapse
 
memitaru profile image
Ami Scott (they/them)

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

Collapse
 
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.

Collapse
 
nocnica profile image
Nočnica Mellifera

Awesome! I look forward to reading it.

Collapse
 
michaeltharrington profile image
Michael Tharrington

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

Collapse
 
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

Collapse
 
nocnica profile image
Nočnica Mellifera

Thank you! I need to update this post :)

Collapse
 
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?

Collapse
 
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 :)

Collapse
 
hybriscole profile image
Alberto Cole❌

late capitalism problems™

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