git-branch
Main Git command for working with branches. tldr-pages
On several platforms
Several platforms
List all branches (local and remote; the current branch is highlighted by *)
git branch --allIdentifyList which branches include a specific Git commit in their history
git branch --all --contains commit_hashIdentifyShow the name of the current branch
git branch --show-currentIdentifyCreate new branch based on the current commit
git branch branch_nameIdentifyCreate new branch based on a specific commit
git branch branch_name commit_hashIdentifyRename a branch
git branch --move old_branch_name new_branch_nameIdentifyDelete a local branch (you must switch to a different branch before doing this)
git branch --delete branch_nameIdentifyDelete a remote branch
git push remote_name --delete remote_branch_nameIdentify