Git

Git: git switch -c <branch> — Windows

Create and switch to a branch.

Availability: Third-party software; install and version dependent.中文

Syntax

git switch -c <branch>

Examples

Create and switch to a branch.

git switch -c <branch>

Parameters, options and clauses

Option / clauseDescription
-c, --create <branch>Create a branch and switch to it.
-C, --force-create <branch>Create or reset a branch before switching; this may move a branch reference.
--trackSet up upstream tracking for the new branch.
--detachSwitch to a commit without attaching HEAD to a branch.
Safety note

Review a command and its target before running it. Commands that alter files, services, accounts, disks, permissions or databases may be difficult to reverse. Test in a safe environment and keep backups.

Official reference ↗Back to directory