r/programming • • Jun 14 '20

GitHub will no longer use the term 'master' as default branch because of negative association

https://twitter.com/natfriedman/status/1271253144442253312
3.3k Upvotes

2.4k comments sorted by

View all comments

938

u/SuspiciousScript Jun 14 '20

Isn't this gonna break a lot of scripts?

611

u/jl2352 Jun 14 '20

This is going to break fucktonnes.

Git does have changes, and they do that by adding the changes behind configs and settings. So scripts don't break by default.

121

u/GamerSinceDiapers Jun 14 '20

How so? Existing repos shouldn't be affected.

0

u/[deleted] Jun 15 '20

[deleted]

0

u/[deleted] Jun 15 '20

[deleted]

6

u/tester346 Jun 15 '20

What makes you think that Microsoft is responsible for this change on Github?

AFAIK Github despite being owned by MS works kinda independently

→ More replies (6)
→ More replies (20)

139

u/PristineReputation Jun 14 '20

New ones are, and there are plenty of tools that setup a Git repo for you for example

→ More replies (1)
→ More replies (1)
→ More replies (17)

107

u/[deleted] Jun 14 '20

I'd rather wait on a post from github over a comment on twitter that explains nothing, but I imagine this will only be something done for new repos.

66

u/Johnothy_Cumquat Jun 15 '20

I seriously doubt they'll creep into everyone's repos and start changing branch names. In fact I never considered the possibility until now

68

u/[deleted] Jun 15 '20

I never considered master being an offensive branch name myself. And yet here we are

6

u/Johnothy_Cumquat Jun 15 '20

I just wish they were changing it to "trunk" instead of "main". It's more punny

→ More replies (6)
→ More replies (1)
→ More replies (4)

4

u/13steinj Jun 15 '20

Even if it's for new repos, it breaks scripts that are meant to exist regardless of repo/parametrized to the repo. Changing defaults is never good.

I will go out of my damned way to name the default branch back to normal before the age of virtue signalling bullshit.

→ More replies (1)

39

u/3nodeproblem Jun 14 '20

I have to assume this will only affect newly created repos. In which case nothing will break, as repo owners can already choose whatever default branch they want and master is simply the default default.

48

u/Cheueue Jun 15 '20

It'll definitely break tools that assume the existence of master, even for new repos. It will also break compatibility with existing deployments of git hosting systems that can't be changed for compatibility reasons.

We'll likely have to deal with the repercussions of github's pointless and shortsighted decision for years to come. All this for a PR stunt.

Github get's a big -1 from me.

7

u/3nodeproblem Jun 15 '20 edited Jun 15 '20

It'll definitely break tools that assume the existence of master, even for new repos.

Then those tools are already broken. For your own repos, nothing will stopping you from using master and setting it as default branch. For other repos you just can't assume invariants will hold for arbitrary third-party repos.

I came in here agnostic but damn, if this is how y'all write your tooling and integration, I start being more in support only for the sake of finally getting those kinds of horrible bugs fixed. Use tagged releases or at least configure gitrefs on a per-repo basis, please.

It will also break compatibility with existing deployments of git hosting systems that can't be changed for compatibility reasons.

Could you elaborate how this would happen? I can't see how that could occur.

6

u/algerd_by Jun 15 '20

Why do we need this in a first place?

→ More replies (5)
→ More replies (2)

4

u/mouth_with_a_merc Jun 15 '20

It will only affect new repos where the initial commit is made via GitHub. If you push your local master, it'll be named master on GitHub as well... that's just how git works.

→ More replies (1)
→ More replies (9)

8

u/corner-case Jun 15 '20

Well, you shouldn't have made a racist script /s

30

u/Hrothen Jun 14 '20

Any script or tool that assumes the default branch in anything but a brand-new repo is named master would already be incredibly brittle. It's not like it's uncommon to have a different name, dev probably being the most common.

→ More replies (4)

52

u/Farsyte Jun 14 '20

This depends on how they go.

1/ Maybe they are just going to allow people to designate a different branch as the default to check out. WAIT, THEY ALREADY DO THIS.

2/ Maybe they are going to allow people to switch. WAIT, WE CAN ALREADY DO THIS.

so that leaves, if they are actually doing anything,

3/ Renaming all the "master" branches in Github, breaking most* clones of most* repositories and most* continuous integration and continuous development system implementations ... ?

Not something that has been thought out. I suspect it was someone posting this for just long enough to get whatever positive PR value they can, then walking it back to get the upset folks calmed back down.

(* I suspect "most" is really "every" but surely someone has an example of a carefully crafted setup where they are proof against the sudden renaming of their most critical branch.)

91

u/kankyo Jun 14 '20

Or 4) when creating a repo via the web GUI they default to another name. This is by far the most likely. This won't break a lot.

14

u/Farsyte Jun 14 '20

So basically a change in the repo creation front end? No biggie then, anyone using tooling that depends on the main / trunk / golden / release / whatever branch vexing called master just keeps calling it that.

Irritated mode off 👍

→ More replies (1)
→ More replies (4)

12

u/Raknarg Jun 14 '20

maybe they just change the defaults for future projects

→ More replies (14)

2

u/Autoradiograph Jun 15 '20

Search/Replace.

Fixed the script!

→ More replies (30)