Skip to content

Latest commit

 

History

History
24 lines (16 loc) · 505 Bytes

add-new-branch-and-switch.md

File metadata and controls

24 lines (16 loc) · 505 Bytes

How to Add a New Branch and Switch to It


You can create a new branch using git branch:

$ git branch <new-branch>

You can switch to the new branch using git switch:

$ git switch <new-branch>

You can do both steps in one by using the -c flag with git switch and passing in the name of the new branch you want to create:

$ git switch -c <new-branch>

git branch git switch