What is git checkout -b <branchname> for ?
I mean, you can create a branch by doing git branch <branchname>
but, what it does git checkout -b <branchname> specifically ?
What is git checkout -b <branchname> for ?
I mean, you can create a branch by doing git branch <branchname>
but, what it does git checkout -b <branchname> specifically ?
That means you do two things:
<branchname><branchname>It's simply shorthand for creating a new branch and then directly checking it out.
$ git checkout -b new-feature
Is shorthand for and the equivalent of:
$ git branch new-feature
$ git checkout new-feature
For reference, please see the documentation on git-branch.