Taylor Blau GitHub Blog

Git 2.28 brings `init.defaultBranch`  ↦

Leading off the updates for Git 2.28 is the highly sought after ability to configure init.defaultBranch so folks can move from master to main as their default branch name.

From Taylor Blau on the GitHub blog:

When you initialize a new Git repository from scratch with git init, Git has always created an initial first branch with the name master. In Git 2.28, a new configuration option, init.defaultBranch is being introduced to replace the hard-coded term. (For more background on this change, this statement from the Software Freedom Conservancy is an excellent place to look).

Starting in Git 2.28, git init will instead look to the value of init.defaultBranch when creating the first branch in a new repository. If that value is unset, init.defaultBranch defaults to master

Also check out github/renaming to learn more about the complementary changes GitHub is making. GitLab and Bitbucket are making similar changes.

Git 2.28 brings `init.defaultBranch`


Sign in or Join to comment or subscribe

0:00 / 0:00