DEV Community

Jonathan Yeong
Jonathan Yeong

Posted on

Git 2.28 brings default branch option

Git 2.28 dropped yesterday (July 27, 2020) and it brings a nifty feature to set a default branch.

$ git config --global init.defaultBranch main
🔴 Live TV: jonathanyeong/git brings default branch option lio - Pertandingan Hari Ini 🔴 Live TV: jonathanyeong/git brings default branch option lio - Pertandingan Hari Ini

Any projects initialized with git init will now use the branch name main.

For more highlights of Git 2.28: https://github.blog/2020-07-27-highlights-from-git-2-28/

Top comments (8)

🔴 Live TV: jonathanyeong/git brings default branch option lio - Pertandingan Hari Ini
 
ben profile image
Ben Halpern •

Timely

🔴 Live TV: jonathanyeong/git brings default branch option lio - Pertandingan Hari Ini
 
somedood profile image
Basti Ortiz •

It shouldn't be too difficult to adjust to. I'm glad they decided on main. More or less, main does have the same semantics as master—minus the potential to hint at certain controversial topics.

🔴 Live TV: jonathanyeong/git brings default branch option lio - Pertandingan Hari Ini
 
adam_cyclones profile image
Adam Crockett 🌀 • • Edited

I didn't ever want to be racist, it's just a word that lets me checkout some code 😭, I live in Bristol UK where we pull down statues of slave traders, BLM support here is strong, it's making me reevaluate a few things. Maybe master is derived from slavery after all?

🔴 Live TV: jonathanyeong/git brings default branch option lio - Pertandingan Hari Ini
 
shalvah profile image
Shalvah •

Don't worry, your choice of branch name doesn't make you racist. It's about how you treat others. Don't overthink it.

🔴 Live TV: jonathanyeong/git brings default branch option lio - Pertandingan Hari Ini
 
markohologram profile image
Marko A •

You are overthinking it. I also think this has been blown way out of proportions really.

I don't think I've ever read anywhere online (before this became big news this year) that people were considering master as a insulting term for a branch name when using version control.

I know it's easy to change the master branch name in a git repository, but this whole thing feels like "solving" a problem that doesn't really exist.

Unfortunately for someone that might start learning git, this whole "dropping master" thing will could make it super confusing based on all existing tutorials and learning material.

🔴 Live TV: jonathanyeong/git brings default branch option lio - Pertandingan Hari Ini
 
190245 profile image
Dave •

I'm with you.

Our default branch is "development" and because we can have different versions in different environments, we've never used the "master" branch.

Branches don't have subordinates so the race debate isn't really appropriate here. All branches end up in the "Dev" branch after MR, so they're all equal.

That we can now configure the default, just means I don't have to delete a local branch when starting a new project. Whoopie. I'll probably forget & try anyway the first 20 or so times.

🔴 Live TV: jonathanyeong/git brings default branch option lio - Pertandingan Hari Ini
 
stokesm profile image
Matthew Stokes •

The original intention of the term in the context of git is as in "master record".

🔴 Live TV: jonathanyeong/git brings default branch option lio - Pertandingan Hari Ini
 
matthijsewoud profile image
⚡️ •

Honestly, this won’t influence me at all. If I unit or push, I only really have to type ‘add remote origin’. You won’t see the branch name if ever if you’re a solo Dev on small projects.

Some comments have been hidden by the post's author - find out more