xxxxxxxxxx
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
xxxxxxxxxx
// Example for creating a new branch named myNewBranch
git checkout -b myNewBranch
// First Push
git push --set-upstream origin myNewBranch
xxxxxxxxxx
// create a branch
git branch <branchName>
// create a branch and switch to it a the same time use
git checkout -b <branchName>
// switch to a branch
git checkout <branchName>
// or
git switch <branchName>