GIT-BRANCH(1) (NAME) git-branch - (SYNOPSIS) git branch [--color[=] | --no-color] [--show-current] [-v [--abbrev= | --no-abbrev]] [--column[=] | --no-column] [--sort=] [--merged []] [--no-merged []] [--contains []] [--no-contains []] [--points-at ] [--format=] [(-r|--remotes) | (-a|--all)] [--list] [...] git branch [--track[=(direct|inherit)] | --no-track] [-f] [--recurse-submodules] [] git branch (--set-upstream-to=|-u ) [] git branch --unset-upstream [] git branch (-m|-M) [] git branch (-c|-C) [] git branch (-d|-D) [-r] ... git branch --edit-description [] (DESCRIPTION) --list . (linked worktrees) . -r (remote- tracking) -a . (wildcard) . . --list . --contains ( ) --no-contains . --merged ( ) . --no-merged . HEAD ( ) . HEAD ( ) . ... (merge base) ( ). HEAD . git switch . ( branch..remote branch..merge) git pull . branch.autoSetupMerge . --track --no-track git branch --set-upstream-to . -m -M . (reflog) . -M . -c -C -m -M . -d -D . . . -r -d . git fetch . prune git-remote(1) . (OPTIONS) -d, --delete . HEAD --track --set-upstream-to . -D --delete --force. --create-reflog (reflog) . @{yesterday} . (non-bare) core.logAllRefUpdates . --no-create-reflog --create-reflog core.logAllRefUpdates . -f, --force . -f git branch . -d ( --delete) . -m ( --move) -c ( --copy) . git branch -f [] -f . -m, --move / . -M --move --force. -c, --copy . -C --copy --force. --color[=] . always () never auto . --no-color . --color=never. -i, --ignore-case . --omit-empty . --column[=], --no-column . column.branch . --column --no-column always never . (non-verbose) . --sort= . - . --sort= . git-for-each- ref(1) . branch.sort ( ) ( refs/..) . HEAD ( ) . git- config(1) . -r, --remotes ( -d) . --list () . -a, --all . --list () . -l, --list . .. git branch --list 'maint-*' () . --show-current . HEAD (detached) . -v, -vv, --verbose sha1 ( ) . ( ) ( git remote show ). HEAD ( ). -q, --quiet . --abbrev= . core.abbrev . --no-abbrev sha1 . -t, --track[=(direct|inherit)] branch..remote branch..merge <<>> (upstream) . git status git branch -v . git pull (pull) . : -t --track --track=direct --track=inherit . branch.autoSetupMerge git switch git checkout git branch --track --no-track : true --track=direct . false --no-track . always --track=direct . inherit --track=inherit . simple --track=direct . branch..remote branch..merge git-pull(1) git- config(1) . --no-track <<>> branch.autoSetupMerge . --recurse-submodules ! submodule.propagateBranches . submodule.propagateBranches git-config(1) . . (superproject) . git branch --recurse-submodules topic origin/main <> <> <> . --set-upstream . --track --set-upstream-to . -u , --set-upstream-to= . . --unset-upstream . . --edit-description ( format-patch request-pull merge ( )). . --contains [] ( HEAD). --list . --no-contains [] ( HEAD). --list . --merged [] ( HEAD). --list . --no-merged [] ( HEAD). --list . --points-at . --format %(fieldname) . git-for-each-ref(1) . . git-check-ref-format(1) . . . . HEAD . . . . . (CONFIGURATION) pager.branch --list . (pager) . git-config(1) . git-config(1) . : branch.autoSetupMerge git branch git switch git checkout git-pull(1) . --track --no-track . true . : false true always inherit simple . branch.autoSetupRebase git branch git switch git checkout (pull) (rebase) ( branch..rebase ). : never true . local true . remote true . always true . branch.autoSetupMerge . never . branch.sort git-branch(1) . --sort= . git-for-each-ref(1) . branch..remote git fetch git push . remote.pushDefault ( ) . branch..pushRemote . origin remote.pushDefault . . ( ) ( ) branch..merge . branch..pushRemote branch..remote . remote.pushDefault . ( ) ( ) remote.pushDefault . branch..merge branch..remote . git fetch/git pull/git rebase git push ( push.default ). git fetch refspec FETCH_HEAD . refspec branch..remote . git pull ( git fetch ) . git pull refspec . (octopus merge) . git pull branch..merge . ( ) branch..remote . branch..mergeOptions . git-merge(1) . branch..rebase true git pull (rebase) . pull.rebase . merges ( m) --rebase-merges git rebase ( git-rebase(1) ). interactive ( i) . : ( git-rebase(1) ). branch..description git branch --edit-description . format-patch request-pull . (EXAMPLES) $ git clone git://git.kernel.org/pub/scm/.../linux-2.6 my2.6 $ cd my2.6 $ git branch my2.6.14 v2.6.14 (1) $ git switch my2.6.14 1. <> . $ git clone git://git.kernel.org/.../git.git my.git $ cd my.git $ git branch -d -r origin/todo origin/html origin/man (1) $ git branch -D test (2) 1. <> <> <> . git fetch git pull . git-fetch(1) . 2. <> <> ( ) test . $ git branch -r -l '/' (1) $ git for-each-ref 'refs/remotes//' (2) 1. -a . 2. for-each-ref . git-for-each-ref(1) . () . (NOTES) git switch -c . --contains --no-contains --merged --no-merged : o --contains (rebase) (amend) . o --no-contains . o --merged HEAD . o --no-merged HEAD HEAD . --contains --no-contains --contains --no-contains . --merged --no-merged --merged --no-merged . (SEE ALSO) git-check-ref-format(1), git-fetch(1), git-remote(1), "Understanding history: What is a branch?"[1] . (GIT) git(1) (NOTES) 1. "Understanding history: What is a branch?" file:///usr/share/doc/git-doc/user-manual.html#what-is-a-branch Git 2.55.0 2026-06-29 GIT-BRANCH(1)