git branch

Manage branches: create, list, rename, and delete branches

Syntax

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

Parameters

ParametersDescriptionExamplesLevel
-a --all (+) git branch -a Common
-d --delete git branch -d feature-x Common
-D () git branch -D experiment
-m --move git branch -m old-name new-name Common
-v --verbose git branch -v Common

Examples

New

git branch feature-login

git branch -a

git branch -d feature-done

git branch -m new-name

git branch --merged

Common Errors

error: branch 'x' not found, git branch -a
error: The branch 'x' is not fully merged, -D

Tips

Related Commands