git switch
BranchingSwitch branches (newer alternative to checkout)
Options & Flags
Available options for this command
-cCreate and switch to new branch
Examples
Common usage examples
Switch to main branch
git switch mainCreate and switch to new branch
git switch -c feature-xNotes
- Introduced in Git 2.23 as clearer alternative to checkout
Related Commands
You might also find these useful