Skip to content

Instantly share code, notes, and snippets.

@modster
Forked from prof3ssorSt3v3/main-branch.md
Created June 11, 2023 07:05
Show Gist options
  • Save modster/3e99fd0e6a8d05ef273a1c871daceee1 to your computer and use it in GitHub Desktop.
Save modster/3e99fd0e6a8d05ef273a1c871daceee1 to your computer and use it in GitHub Desktop.

Github's New Default Branch - Main

Z-shell website

https://ohmyz.sh/

Git Downloads Page

https://git-scm.com/downloads

Locations for Git Installs for Aliasing

alias git='/usr/local/bin/git' 
# for the installer pkg
alias git='/usr/local/Cellar/git/[0-9.]*/bin/git' 
# for Homebrew
plugins(git)

New Git CLI Commands

git config --global init.defaultBranch main

git init -b main

If you are still using a version of Git prior to version 2.28.x Then you can still work with the changes in Github. Just create a new branch called main and switch to that. The following command will create the main branch and switch to it.

git checkout -b main

Then, if you want you can delete the master branch.

git branch -d master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment