DEV Community

Discussion on: Change Git's Default Branch From Master

Collapse
 
dnsmichi profile image
Michael Friedrich

git 2.28 now allows to set a default branch name: git config --global init.defaultBranch main :)

lwn.net/Articles/827174/
The name of the primary branch in existing repositories, and the
default name used for the first branch in newly created
repositories, is made configurable, so that we can eventually wean
ourselves off of the hardcoded 'master'.

Collapse
 
lukeocodes profile image
@lukeocodes πŸ•ΉπŸ‘¨β€πŸ’»

Oh, thanks Michael! I'll update the post!

Collapse
 
shvahabi profile image
Shahed

For a repository-wise intended name we can use: git init --initial-branch=stable