Create and switch to a new branch.
git switch -c <branch>Create and switch to a new branch.
git switch -c <branch>Create and switch to a new branch.
git switch -c <branch>| Option / clause | Description |
|---|---|
-c, --create <branch> | Create a branch and switch to it. |
-C, --force-create <branch> | Create or reset a branch before switching; may move a branch reference. |
--track | Set up upstream tracking for the new branch. |
--detach | Switch to a commit without attaching HEAD to a branch. |
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.