Switch Branches
Git · Branchingsyntax
git switch <branch>
git switch -c <new-branch>example
git switch feature/user-profile
# Create and switch in one step:
git switch -c feature/paymentsoutput
Switched to branch 'feature/user-profile'Note git switch is the modern replacement for git checkout (for branch switching). The -c flag creates the branch if it doesn't exist. You'll get an error if you have uncommitted changes that conflict with the target branch.