create a new branch and push to github code example

Example 1: create new branch git

$ git checkout -b [name_of_your_new_branch]

Example 2: git push to branch

# If its your first push
git push -u origin BRANCH

# Otherwise
git push origin BRANCH

Example 3: push a new branch

git push -u origin <branch-name>

Example 4: how to create new branch

How to create a new branch in git 

$ git checkout -b good

here good is new branch name
the line 3 after executing we will go to that branch

Example 5: git push in a new branch

git checkout -b <branch>
git add .
git commit -m "comment"
git push -u origin <branch>

Example 6: create a new branch and publish gitub

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

Tags:

Misc Example