No latest branch
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.
Ah, I love coherent software.
Switch and restore came later because checkout was problematic.
Just alias stuff like that, make it coherent.
I renamed my master branch slaveowner. To make it more clear.
It is software, my friends. It’s not a tribe of people.
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.
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.
There are no slave branches like there are no slave recordings.
My “master” branch actually does control other branches, as releases are usually made from it, so they all depend on it.
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.
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.
Alright. Doesn't change my main point. Which is the person's name for the master branch is fucking weird.
Master bedroom and master bath also have nothing to do with slavery.
Please grow up.
git push master --force
Transcription
The "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
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.
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.
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.
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
Programmer Humor
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
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics