this post was submitted on 09 Dec 2025
464 points (98.7% liked)

Programmer Humor

28346 readers
631 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
all 45 comments
sorted by: hot top controversial new old
[–] eager_eagle@lemmy.world 46 points 1 month ago (2 children)

it has always bothered me that checkout is overloaded: it can switch branches or discard pending changes in an unrecoverable way.

so, PSA, you can replicate the safe part of checkout with git switch and the unsafe with git restore.

[–] tux0r@feddit.org 14 points 1 month ago (2 children)

Ah, I love coherent software.

[–] sik0fewl@lemmy.ca 13 points 1 month ago (1 children)

Switch and restore came later because checkout was problematic.

[–] nightlily@leminal.space 3 points 1 month ago* (last edited 1 month ago) (1 children)

Has someone made a „Checkout considered harmful“ blog post yet or do we not do that anymore?

[–] anomnom@sh.itjust.works 1 points 1 month ago

E we used to always stash before checkouts to try and find things in a branch

Just alias stuff like that, make it coherent.

[–] Scrollone@feddit.it 1 points 1 month ago (1 children)

I agree, I wonder why they decided to design it that way in the first place.

[–] paperplane@lemmy.world 1 points 2 weeks ago

In both cases, checkout updates your working tree (by checking out either all or just some files from a commit), just when you're switching branches it moves your HEAD pointer too

[–] tux0r@feddit.org 32 points 1 month ago (2 children)

I renamed my master branch slaveowner. To make it more clear.

It is software, my friends. It’s not a tribe of people.

[–] cenzorrll@piefed.ca 18 points 1 month ago (4 children)

You could do that, but I could argue that master/slave nomenclature isnt a good scheme for this anyway, since it doesn't control any other branches. Unlike master and slave drives from the olden days.

By all means go ahead and keep your naming schemes. It's your own stuff that after all, that for some reason you felt the need to tell everyone about. However, I might recommend trying to move past it seeing as language has an impact on how people think, and being edgy doesn't exactly have a good track record of producing the best people.

[–] psycotica0@lemmy.ca 31 points 1 month ago

I always assumed the name was more of a reference to audio Master Recordings.

It's the original tapes or whatever that all copies are derived from. It's also where the term "remastering" comes from, as in "we went in and rebuilt a new master from the individual tracks, and this is the new master now", versus just making another copy of the master for a re-release.

[–] sik0fewl@lemmy.ca 9 points 1 month ago (1 children)

There are no slave branches like there are no slave recordings.

[–] tux0r@feddit.org 1 points 1 month ago (1 children)
[–] mogranja@lemmy.eco.br 2 points 4 weeks ago

How about a "daddy" branch?

[–] tux0r@feddit.org 2 points 1 month ago

My “master” branch actually does control other branches, as releases are usually made from it, so they all depend on it.

[–] chuckleslord@lemmy.world -1 points 1 month ago* (last edited 1 month ago) (3 children)

Not gonna lie, the master branch thing has been perceived as problematic but I don't typically see an issue with it. It's similar to master bedroom or bath. ~~Kind of fucked up name origin, but~~ I don't think anyone's really making a fuss about it.

Whatever the fuck you're doing though feels like some gross, racist fantasy. It's really weird, dude. If you think that's funny you might need to go talk to some real people or touch grass.

[–] expr@programming.dev 19 points 1 month ago (2 children)

Wtf are you talking about? It doesn't have a fucked up name origin at all. It was named "master" as in "master recording", like in music production. Proof: https://x.com/xpasky/status/1271477451756056577.

Master/slave concepts were never a thing in git. The whole renaming thing was really fucking stupid. Caused plenty of breakage of scripts and tools for absolutely no good reason whatsoever.

[–] chuckleslord@lemmy.world 2 points 1 month ago (1 children)

Alright. Doesn't change my main point. Which is the person's name for the master branch is fucking weird.

[–] locuester@lemmy.zip 4 points 1 month ago

It is weird. So what? It’s just a branch name in a software control system. That’s the point they’re trying to make.

[–] ZoteTheMighty@lemmy.zip 1 points 1 month ago

Where did the term master recording come from?

[–] sik0fewl@lemmy.ca 8 points 1 month ago (2 children)

Master bedroom and master bath also have nothing to do with slavery.

[–] Digit@lemmy.wtf 2 points 1 month ago

They don't?

I'm doing it wrong.

[–] sping@lemmy.sdf.org 2 points 1 month ago

Master's degrees though — racist as fuck.

[–] tux0r@feddit.org -3 points 1 month ago

Please grow up.

[–] boredsquirrel@slrpnk.net 31 points 1 month ago* (last edited 1 month ago)

git push master --force

[–] majster@lemmy.zip 15 points 1 month ago

I still see master branches everywhere, even my new personal repos. This git renaming story is one of the most stupid OSS pushes I remember. That and Gimp fork, that then died out I think.

[–] falseWhite@lemmy.world 11 points 1 month ago
[–] Zagorath@aussie.zone 11 points 1 month ago

TranscriptionThe "It's an Older Meme, But It Checks Out" meme, featuring an image of an Imperial officer from Star Wars, with the caption:

It's an older branch, sir

But it checks out

[–] Zagorath@aussie.zone 8 points 1 month ago (3 children)

I usually create new repos through GitHub or another central repo's system, where it defaults to calling the main branch main. But I did recently create a new repo with my local Git's git init, and had to deal with a master branch on a completely new repo for the first time in a while. It was actually kinda a weird experience.

[–] NuXCOM_90Percent@lemmy.zip 24 points 1 month ago* (last edited 1 month ago)
git checkout -b main
git branch -D master
git config --global init.defaultBranch main

You don't have to deal with shit if you don't want to.

[–] dohpaz42@lemmy.world 8 points 1 month ago (1 children)

If you haven’t already found it, you need to change your global git config (~/.gitconfig):

git config --global init.defaultBranch main

(or whatever you want to call it; e.g. daddy would work too)

For any existing repositories you want to run the following command in the existing repository root (./.git/config):

git config set init.defaultBranch main

[–] Digit@lemmy.wtf 3 points 1 month ago

daddy branch.

Love it.

[–] pageflight@lemmy.world 2 points 1 month ago

Yeah, current company has their internal git server default to master and it was a little odd first time I created a new repo. Luckily all the CI templates can recognize either name so I just switched it.

[–] ripcord@lemmy.world 2 points 1 month ago

No latest branch

[–] Heavybell@lemmy.world 1 points 1 month ago

I never understood why we moved away from "trunk".