how to create a new git branch in terminal code example

Example 1: create new branch git

$ git checkout -b [name_of_your_new_branch]

Example 2: creating a branch in git

git checkout -b <branch_name>

Example 3: 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 4: create new branch git

$ git checkout --track origin/newsletter
Branch newsletter set up to track remote branch newsletter from origin.
Switched to a new branch 'newsletter'