Command

Git Create and Switch Branch Command

The Git command to create and switch branch is git switch -c <name>.

Quick Answer

Command
git switch -c <name>
GitCommand

Create and Switch Branch

Type this command
git switch -c <name>

Creates a new branch and switches to it.

Tip: Older equivalent: git checkout -b <name>.

Learn More

How to create and switch branch in Git

  1. Open the terminal or command interface for Git.
  2. Type git switch -c <name>, replace any placeholders, and run it.

Tip: Older equivalent: git checkout -b <name>.

Git Create and Switch Branch Command

Run git switch -c <name>.

Related Commands

Frequently asked questions

What is the Git command to create and switch branch?

Run git switch -c <name>.

Where do I type this Git command?

Type it in the terminal or command-line interface used by Git.

Does this Git command work on Mac and Windows?

Yes. The command text is the same on both platforms when the tool is installed.

Official source · How we verify