Forrest logo
back to the git tool

git-create-branch:tldr:6b26e

git-create-branch: Create a local branch.
$ git create-branch ${branch_name}
try on your machine

The command "git create-branch ${branch_name}" is not a valid Git command. There is no built-in Git command called "create-branch".

However, Git provides a command called "checkout" that can be used to create and switch to a new branch at the same time. The correct command to create and switch to a new branch would be:

git checkout -b ${branch_name}

In this command, ${branch_name} is a placeholder for the name of the new branch you want to create. You should replace ${branch_name} with an actual branch name of your choice.

Executing this command will create a new branch with the specified name and switch your active branch to the newly created branch.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the git tool