DEV Community

loading...

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 🕹👨‍💻 Author

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

Collapse
shvahabi profile image
شاهد

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

Forem Open with the Forem app