Skip to content

Latest commit

 

History

History
11 lines (6 loc) · 345 Bytes

git-branch-vs-git-checkout-b.md

File metadata and controls

11 lines (6 loc) · 345 Bytes

Git branch vs git checkout -b

When creating a new branch, you can use git branch but also git checkout -b, the difference is as follows:

Git branch:

git branch BRANCH_NAME creates a new branch but leaves you on the same branch.

Git checkout -b:

git checkout -b BRANCH_NAME creates a new branch and checks out the new branch.