Git create and checkout new branch
Use the -b
flag with git checkout
to create and checkout a new branch in one command.
# old way
git branch newbranch
git checkout newbranch
# new way
git checkout -b newbranch
Use the -b
flag with git checkout
to create and checkout a new branch in one command.
# old way
git branch newbranch
git checkout newbranch
# new way
git checkout -b newbranch