git branch

List, create, or delete branches

Options

NameDescription
-a, --allList both remote-tracking and local branches
-d, --delete <arg...>Delete fully merged branch
-D <arg...>Delete branch (even if not merged)
-m, --move <arg> <arg>Move/rename a branch and its reflog
-M <arg> <arg>Move/rename a branch, even if target exists
-c, --copyCopy a branch and its reflog
-CCopy a branch, even if target exists
-l, --listList branch names
--create-reflogCreate the branch's reflog
--edit-description <arg>Edit the description for the branch
-f, --forceForce creation, move/rename, deletion
--merged <commit>Print only branches that are merged
--no-merged <commit>Print only branches that are not merged
--columnList branches in columns [=<style>]
--no-columnDoesn't display branch listing in columns
--sort <key>Field name to sort on
--points-at <object>Print only branches of the object
-i, --ignore-caseSorting and filtering are case insensitive
--format <format>Format to use for the output
-r, --remotesLists or deletes (if used with -d) the remote-tracking branches
--show-currentPrints the name of the current branch
-v, --verbose
  • Repeatable ♾
  • Repeatable 2x
-q, --quietSuppress non-error messages
--abbrev <Number>Shows the shortest prefix that is at least <n> hexdigits long that uniquely refers the object
--no-abbrevDisplays the full sha1s in the output listing
-t, --track <branch> [start point]When creating a new branch, set up 'upstream' configuration
--no-track <arg> [arg]Do not set up 'upstream' configuration, even if the branch.autoSetupMerge configuration variable is true
-u, --set-upstream-to [upstream]Sets branch to upstream provided
--unset-upstream [upstream]Removes the upstream information
--contains [commit]Only lists branches which contain the specified commit
--no-contains [commit]Only lists branches which don't contain the specified commit
--color [when]Color branches to highlight current, local, and remote-tracking branches
--no-colorTurns off branch colors