Cheatsheet Pages / Git Cheatsheet

How to make main the default branch for new Git repos

You want every repository you create from now on to start with a main branch instead of master.

git config --global init.defaultBranch main   # default branch for new repos

Good to know

New repos (and git init) will use main instead of master.

Git Cheatsheet one-page card — 30 daily and rescue commands
The full one-page card — Git Cheatsheet. Get the complete cheatsheet on GitHub