DEV Community


Discussion on: Change Git's Default Branch From Master

dnsmichi profile image
Michael Friedrich

git 2.28 now allows to set a default branch name: git config --global init.defaultBranch main :)
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'.

lukeocodes profile image
@lukeocodes 🕹👨‍💻 Author

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

shvahabi profile image

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

Forem Open with the Forem app