Command

git switch

Select an existing branch or create and select a new one. Git ordinarily refuses a switch that would overwrite local changes. Introduced in Git 2.23.

Formal Syntax & Structure

git syntaxgit
git switch BRANCH | git switch -c NEW

Working Example

Example Snippetgit
git switch -c feature
Git Reference