how to create new branch in github and push code example

Example 1: create new branch git

$ git checkout -b [name_of_your_new_branch]

Example 2: git new branch

$ git checkout -b [your_branch_name]
# Switched to a new branch [your_branch_name]

# This is shorthand for:
$ git branch [your_branch_name]
$ git checkout [your_branch_name]

Example 3: create a new branch and publish gitub

git checkout -b <branch>
git push -u origin <branch>

Example 4: create a branch command

$ git fetch [name_of_your_remote]

Tags:

Misc Example