How to list local branches?
- 1 Min. Read.
The command for listing local branches in git is:
1 |
git branch |
There are many options available:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
Generic options -v, --verbose show hash and subject, give twice for upstream branch -q, --quiet suppress informational messages -t, --track set up tracking mode (see git-pull(1)) --set-upstream change upstream info -u, --set-upstream-to <upstream> change the upstream info --unset-upstream Unset the upstream info --color[=<when>] use colored output -r, --remotes act on remote-tracking branches --contains <commit> print only branches that contain the commit --abbrev[=<n>] use <n> digits to display SHA-1s Specific git-branch actions: -a, --all list both remote-tracking and local branches -d, --delete delete fully merged branch -D delete branch (even if not merged) -m, --move move/rename a branch and its reflog -M move/rename a branch, even if target exists --list list branch names -l, --create-reflog create the branch's reflog --edit-description edit the description for the branch -f, --force force creation, move/rename, deletion --merged <commit> print only branches that are merged --no-merged <commit> print only branches that are not merged --column[=<style>] list branches in columns --sort <key> field name to sort on --points-at <object> print only branches of the object |