SyntaxStudy
Sign Up
Home Git Reference git branch

git branch

command

Lists, creates, or deletes branches. Without arguments, lists all local branches.

Syntax

git branch [name] [options]

Example

bash
git branch                  # list local branches
git branch -a               # list all (including remote)
git branch feature/login    # create branch
git branch -d feature/login # delete (safe)
git branch -D feature/login # force delete
git branch -m old new       # rename branch