You can create a new branch using git branch
:
$ git branch <new-branch>
You can switch to the new branch using git checkout
:
$ git checkout <new-branch>
You can do both steps in one by using the -b
flag with git checkout
and passing in the name of the new branch you want to create:
$ git checkout -b <new-branch>