how to create and switch to a branch git code example

Example 1: git command to create a branch

//Create a New Branch
git checkout -b [name_of_your_new_branch]
//First Push
git push --set-upstream origin [name_of_your_new_branch]

Example 2: canging branch in git

$ git checkout <existing_branch>

$ git checkout -b <new_branch>

Example 3: git command to create a branch from another branch

$ git checkout -b myfeature dev

Example 4: canging branch in git

$ git checkout feature

Example 5: git create branch

$ git checkout -b iss53
Switched to a new branch "iss53"

Example 6: git create branch

$ vim index.html
$ git commit -a -m 'Create new footer [issue 53]'

Tags:

Misc Example