loading...

I've changed default branch from Master to Main

thefern profile image Fernando B 🚀 Updated on ・1 min read

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

Posted on by:

thefern profile

Fernando B 🚀

@thefern

Coding space junkie with a sprinkle of writer heart. DMs open for any questions or comments. 🙂

Discussion

pic
Editor guide
 

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