link
git/switch

Switch Branches (New)

Switch branches (Git 2.23+)

git
switch
branch

Command

git switch

Examples

Switch to main branch

git switch main

Create and switch to new branch

git switch -c new-branch