Cédric Champeau's blog: Configuring git to use main instead of master
source link: http://melix.github.io/blog/2020/06/updating-git.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Configuring git to use main instead of master
17 June 2020
Tags: git github blacklivesmatter
I don’t need to explain the backstory, and I am not interested in a discussion whether this change makes sense or not, nor am I interested in the technical problems it could cause if someone changes the name: technical issues shouldn’t be a reason to stop us from improving.
Actually, if you are reading this, there are good chances you’re already in the mindset of removing potentially offensive language from your project, thank you!
The fact is, we have better, more descriptive technical names than "master" and "slave" and we don’t have to use terms which refer to dark ages of our history, so let’s get rid of them in tech.
In this blog post, you will learn:
-
how to make
git init
create your project with amain
branch instead ofmaster
-
how to rename your
master
branch tomain
-
how to make the change on GitHub
Be aware that renaming branches may break your existing integrations (typically with CI or Slack notifications) so only do it when you’re ready.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK