this post was submitted on 30 Jan 2025
31 points (79.2% liked)

Technology

61227 readers
5047 users here now

This is a most excellent place for technology news and articles.


Our Rules


  1. Follow the lemmy.world rules.
  2. Only tech related content.
  3. Be excellent to each other!
  4. Mod approved content bots can post up to 10 articles per day.
  5. Threads asking for personal tech support may be deleted.
  6. Politics threads may be removed.
  7. No memes allowed as posts, OK to post as comments.
  8. Only approved bots from the list below, to ask if your bot can be added please contact us.
  9. Check for duplicates before posting, duplicates may be removed
  10. Accounts 7 days and younger will have their posts automatically removed.

Approved Bots


founded 2 years ago
MODERATORS
 

So creating a new repo on GitHub, you get a set of getting started steps. They changed the default branchname to "main" from "master" due to its connotations with slavery.

When I create a new repo now, the initial getting started steps recommend creating a branch named "master" as opposed to "main" as it was a while ago.

It's especially weird since the line git branch -M master is completely unnecessary, since git init still sets you up with a "master" branch.

Disclaimer: I have a bunch of private repos, and my default branchnames are pretty much all "master".

Is this a recent change?

Edit: Mystery solved, my default branchname is "master". Thanks [email protected] !

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 17 points 14 hours ago (1 children)

Main is more concise and less problematic. A win all around.

[–] [email protected] 7 points 12 hours ago (2 children)

is it though?

I treat the master branch as the master record. it's the branch all other branches are made from.

calling it main is overly generic. main to what? the repo? the main feature being worked on? are there multiple mains like in mains voltages?

master seems far more concise. when you think of it like a stateful record.

plus all my pipelines are configured to use master. I would have to rewrite 70+ pipelines just to convert to main.

not worth it.

[–] [email protected] 3 points 1 hour ago* (last edited 1 hour ago)

It's just a word at the end of the day. To me "main" is literally a shorter word that means the same thing in my brain. It could be "trunk" or "release" or whatever else you'd like. "master" makes some people uneasy, so it seems like a simple solution to pick a different word.

The development community talked, informally settled on main, and here we are. Anecdotally it took me more time to write this than to switch most of my projects over. I use GitHub actions and a simple find/replace for a word not otherwise commonly used was the ticket.

I really don't care what other people use at the end of the day. Discussing version control and branching strategies drains my life away. If it is difficult to switch, don't, but if you start a new repo it is worth thinking about for a moment.