I used git checkout -b
to create a new branch. I think that git branch
does the same thing.
How do these two commands differ, if they differ at all
There are forms of both commands that are similar (looking at git-scm docs Version 2.11.1):
git branch
and
git checkout -b
The latter executing the branch command first and then adding the checkout. In that form explicitly references to git-branch's doc:
Specifying -b causes a new branch to be created as if git-branch[2] were called and then checked out