xxxxxxxxxx
# Create New Branch And Switch To It
$ git checkout -b myBranchName
xxxxxxxxxx
//Create a New Branch
git checkout -b [name_of_your_new_branch]
//First Push
git push --set-upstream origin [name_of_your_new_branch]
xxxxxxxxxx
git branch # List branches
git branch <branch-name> # Create a new branch
git checkout <branch-name> # Switch to the branch
# or combine creation and switch:
git checkout -b <branch-name>
git push -u origin <branch-name> # Push the branch to the remote
mefiz.com
xxxxxxxxxx
// Example for creating a new branch named myNewBranch
// git switch is specifically for branches while git checkout is for
// both branches and commits
git switch -c myNewBranch
// First Push
git push -u origin HEAD