LinuxCommandLibrary

git-create-branch

Create a new Git branch

TLDR

Create a local branch

$ git create-branch [branch_name]
copy

Create a branch locally and on origin
$ git create-branch [[-r|--remote]] [branch_name]
copy

Create a branch locally and on upstream (through forks)
$ git create-branch [[-r|--remote]] upstream [branch_name]
copy

SYNOPSIS

git-create-branch [options] <branchname> [<start-point>]

PARAMETERS

-h, --help
    Display help message

--start-point <commit>
    Branch from specific commit/branch

DESCRIPTION

No standard Git command named git-create-branch exists in official Git distributions.

It may refer to a custom script, alias, or common misspelling/misremembering of git branch, the primary command for managing branches.

git branch <name> [<start-point>] creates a new branch pointing at the current HEAD (or specified start-point).

Common alternatives include git checkout -b <name> (creates and switches) or git switch -c <name> (Git 2.23+). If this is a third-party tool, consult its documentation. Always verify with git --version and git help.

CAVEATS

Not a core Git command; likely custom or erroneous. Use git branch to avoid issues. Fails if repository not initialized (git init).

STANDARD USAGE EXAMPLE

git branch new-feature creates branch from current HEAD.
git checkout new-feature to switch.

COMMON PITFALLS

Branches are pointers; use git push -u origin <name> to track remote. Detached HEAD if on unborn branch.

HISTORY

Git branches introduced in v1.0 (2005); no git-create-branch in core history. Evolved via git branch enhancements in v1.6+.

SEE ALSO

Copied to clipboard