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

Show parent comments

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

3

u/jess-sch Jun 15 '20

Every acquisition ever included some executive promising customers that they're still acting independently.

In reality though that's often not the case.

2

u/NAKED_INVIGILATOR Jun 15 '20

It's never the case, why the fuck would a company purchase another company just to do nothing with it, letting them continue the status quo?

→ More replies (3)

6

u/[deleted] Jun 15 '20

The problem is that you can't really ask a repo what its default branch is from the web.

Uh, yeah you can. It happens as part of the initial clone every time.

12

u/Izzyanut Jun 15 '20

The problem for some scripts is that it adds a lot of complexity.

For example, with Shields mentioned above, they can figure out default GitHub branch via the API, however some badges don't use the API for what they generate, so it would result in two data requests for the badge. Changing the assumed name will break all existing ones as well, which is another issue.

Then there's other services, that integrate with that code base (For example CI/CD) that don't have a way to request the default branch. So you may not have a way to tell what name to use.

Is this going to break everything and have no work arounds? No, but it is going to break a lot of projects that use Git, or that may not be maintained anymore.

→ More replies (7)
→ More replies (2)

1

u/irqlnotdispatchlevel Jun 15 '20

I'm also curious about how other services that look for a master branch will be affected. I imagine that GitHub pages will just start working with main instead of master, but other 3rd parties may stop working for a while.

→ More replies (7)

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)

2

u/karuna_murti Jun 15 '20

but everyone has to change their code to make sure your code does not break since now can guarantee which one is the master main branch anymore.

name == "master" || name == "main" || name == "overlord"

which is just totally virtue signalling, unless people having master's degree change their degree to main's degree.

5

u/mitsuhiko Jun 14 '20

This is going to break fucktonnes.

I'm curious what would break. I haven't noticed a lot which would require you to work on a specific branch. In fact I don't remember any git command or script that would only work on master.

52

u/Lvl999Noob Jun 14 '20

A lot of tooling assumes the main branch to be called master, i think. Those scripts would be the ones breaking. It shouldn't cause too much problem unless the name was hardcoded and used a lot

0

u/mitsuhiko Jun 14 '20

lot of tooling assumes the main branch to be called master, i think.

I haven't come across a lot. Git flow uses develop as the real default branch for years. You normally don't interact with master much in that setup.

0

u/[deleted] Jun 14 '20

[deleted]

12

u/TheWix Jun 14 '20

Yep, merge to master after a successful release

2

u/[deleted] Jun 14 '20

Not positive, but isn’t it the other way around? Release after a successful merge to master?

2

u/LosersCheckMyProfile Jun 15 '20

Yeah they are talking about the old git flow from like 10-20 years ago.

These days all our projects use the master > release/tag pattern

4

u/[deleted] Jun 14 '20

Except if you're not using Git flow. Which is probably a good idea, because Git flow is a horrible branching workflow. You don't need a master branch that only contains tagged commits, you can just tag the commits on your develop branch and use only that. And then call it master, as everyone else does.

→ More replies (3)
→ More replies (1)

17

u/Eirenarch Jun 14 '20

Literally my CI builds are linked to a branch called master.

→ More replies (2)

1

u/200000000experience Jun 15 '20

I would assume it's possible to make 'master' requests just redirect to whatever the new name would be. I dunno, I find it hard to believe they wouldn't think this through in some way.

1

u/[deleted] Jun 15 '20

I don't think so. Like, the right way to do this would be to set the default branch for new repositories to 'main', and encourage existing repositories to migrate, not just fuck with people's repos willy-nilly.