A New Git Default Branch

I learned a new trick from Andrew Pruski. In a blog on avoiding PowerPoint, he had htis neat trick:

git config --global init.defaultBranch main

Apparently, this is a new setting in git v2.28. This allows you to set a default branch for all new repos. Since I often create a local repo first before pushing to a remote, this is handy for me.

This was on the git blog, if you want to know more.

About way0utwest

Editor, SQLServerCentral
This entry was posted in Blog and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.