Create branch (without switching)
git branch sample
If you need to switch branch and make changes.
git checkout -b sample
Push to server
git push origin sample
List branch
git branch
Switch branch
git switch sample
NOTE: switch
is available for Git 2.23
. Check git version (git --version
) and upgrade git if necessary.