Skip to content

Files

Latest commit

 

History

History
27 lines (19 loc) · 573 Bytes

add-new-branch-and-push.md

File metadata and controls

27 lines (19 loc) · 573 Bytes

How to Add a New Branch and Push to A Remote


You can create a new branch using git branch:

$ git branch <new-branch>

You can switch to the new branch using git switch or git checkout:

$ git switch <new-branch>
$ git checkout <new-branch>

Now you can push the new branch to a remote:

$ git push -u origin <new-branch>

git branch git switch git checkout git push