git branch [--set-upstream | --track | --no-track] [-l] [-f] <branchname> [<start-point>]
git branch (--set-upstream-to=<upstream> | -u <upstream>) [<branchname>]
git branch --unset-upstream [<branchname>]
git branch (-m | -M) [<oldbranch>] <newbranch>
git branch (-d | -D) [-r] <branchname>…
git branch --edit-description [<branchname>]
git branch [--color[=<when>] | --no-color] [-r | -a] [--list] [-v [--abbrev=<length> | --no-abbrev]] [--column[=<options>] | --no-column] [(--merged | --no-merged | --contains) [<commit>]] [--sort=<key>] [--points-at <object>] [<pattern>…]
|-d, --delete||Delete a branch. The branch must be fully merged in its upstream branch, or in |
|-D||Shortcut for |
|-m, --move||Move/rename a branch and the corresponding reflog|
|-M||Shortcut for |
|-r, --remotes||List or delete (if used with -d) the remote-tracking branches|
|-a, --all||List both remote-tracking branches and local branches|
|--list||Activate the list mode. |
|--set-upstream||If specified branch does not exist yet or if |
Every git repository has one or more branches. A branch is a named reference to the
HEAD of a sequence of commits.
A git repo has a current branch (indicated by a
* in the list of branch names printed by the
git branch command), Whenever you create a new commit with the
git commit command, your new commit becomes the
HEAD of the current branch, and the previous HEAD becomes the parent of the new commit.
A new branch will have the same
HEAD as the branch from which it was created until something is committed to the new branch.