Skip to content

Files

Latest commit

 

History

History
24 lines (16 loc) · 513 Bytes

add-new-branch-and-switch copy.md

File metadata and controls

24 lines (16 loc) · 513 Bytes

How to Add a New Branch and Checkout


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>

git branch git checkout