git checkout -b BRANCH_NAME
creates a new branch and checks out the new branch while git branch BRANCH_NAME
creates a new branch but leaves you on the same branch.
In other words git checkout -b BRANCH_NAME
does the following for you.
git branch BRANCH_NAME # create a new branch
git switch BRANCH_NAME # then switch to the new branch
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…