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
# create and switch to the new branch
git checkout -b <Name_of_your_branch>
# example
git checkout -b testBranch1
# if you check your current branch it will show you testBranch1
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