Skip to content

Home

Create a new branch

Creates and switches to a new branch, optionally setting up a remote tracking branch.

💡 Tip

You can alternatively use git branch <branch> [-t <remote>/<branch>] and then git checkout <branch> separately.

git checkout -b <branch> [-t <remote>/<branch>]

# Examples
git checkout -b patch-1
# Local branch, without a remote tracking branch

git checkout -b patch-2 -t origin/patch-2
# Local branch and remote tracking branch with the same name

More like this

Start typing a keyphrase to see matching snippets.