Git Cheat Sheet/Create and switch branch

Create and switch in one step.

Section: Branching and Switching

Create and switch branch

bash
bash
git switch -c feature/my-change

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Branching and Switching
Switch branches
Switch to an existing branch.
OpenIn sheetbashsame section
List all branches
Show local and remote-tracking branches.
OpenIn sheetbashsame section
List branches with last commit
Include tracking and latest commit info.
OpenIn sheetbashsame section
Create branch
Create a branch at current HEAD.
OpenIn sheetbashsame section
Rename current branch
Rename current branch.
OpenIn sheetbashsame section
Delete merged branch
Delete a merged local branch.
OpenIn sheetbashsame section