DEV Community

Fernando B 🚀
Fernando B 🚀

Posted on • Updated on

I've changed default branch from Master to Main

I've made a small change to my git configuration, which anyone should be able to do today. I've updated my git to the latest 2.28. I think is a good step for my workflow, as seeing and repeating master on conference calls was a bit aggravating for me.

On Windows:

git update-git-for-windows
Enter fullscreen mode Exit fullscreen mode

Run through the prompts.

On Ubuntu:

Canonical repos might not be up to date, so you will need a ppa repo fortunately there is one for git:

sudo add-apt-repository ppa:git-core/ppa
sudo apt update
sudo apt install git -y
Enter fullscreen mode Exit fullscreen mode

On Mac:

brew ugprade git
Enter fullscreen mode Exit fullscreen mode

I no longer have a mac, so can't confirm this is the latest.

Check version, and update your default branch name. Mine is main, but yours can be something else like latest, production, etc.

git --version
git config --global init.defaultBranch main
Enter fullscreen mode Exit fullscreen mode

Top comments (1)

Collapse
 
toiinnn profile image
Antonio Marcos Oliveira

Thanks! I just updated in my pc here, and I think it's a good change switch from master to main. :D