Git 2.28 brings default branch option
Jonathan Yeong

Jonathan Yeong @jonathanyeong

About: Staff Software Dev originally from Australia - Ruby on Rails is my bread and butter - Helping other devs is my jam.

Location:
Toronto, Canada
Joined:
Jan 6, 2017

Git 2.28 brings default branch option

Publish Date: Jul 28 '20
38 17

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
Enter fullscreen mode Exit fullscreen mode

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/

Comments 17 total

  • Ben Halpern
    Ben HalpernJul 28, 2020

    Timely

  • Adam Crockett 🌀
    Adam Crockett 🌀Jul 28, 2020

    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?

    • Shalvah
      ShalvahJul 29, 2020

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

    • Marko A
      Marko AJul 29, 2020

      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.

      • Dave
        DaveJul 29, 2020

        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.

    • Matthew Stokes
      Matthew StokesJul 29, 2020

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

  • Basti Ortiz
    Basti OrtizJul 29, 2020

    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.

  • ⚡️
    ⚡️Jul 29, 2020

    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.

Add comment