Skip to content
Advertisement

Can’t change git default branch to main on the command line

I’ve read on several sites that you can use git config --global init.defaultBranch main to change the default branch (from master) to main. But it doesn’t work for me. Here it’s from my terminal (my os is ubuntu):

JavaScript

Advertisement

Answer

The option init.defaultBranch was introduced in Git version 2.28. You must be running an older version which does not honor this option.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement