How to List, Create, and Delete Branches in Git (git branch)
git branch manages branches — separate, independent lines of development within the same repository.
Published September 27, 2026
git branch manages branches — separate, independent lines of development within the same repository.
Key points
- Run git branch with no arguments to list all local branches
- git branch new-feature creates a new branch without switching to it
- git branch -d branch-name deletes a branch that has already been merged; -D forces deletion of an unmerged one
Example
git branch new-feature