Which command creates and switches to a new branch in one step?

Git Easy

Git — Easy

Which command creates and switches to a new branch in one step?

Key points

  • `git checkout -b` is a shortcut for creating and checking out a branch.
  • `git branch` only creates a new branch without switching.
  • `git switch` is used to switch between existing branches.
  • `git create` is not a valid Git command.

Ready to go further?

Related questions