git checkout <branchname>
git checkout -b <new branchname>
git branch #list of local branches
git branch -a #list of local and remote branches
git branch -v #verbose list of local branches
git branch -vv #very verbose list of local branches
git remote prune origin
git branch -vv | grep 'origin/.*: gone]' | awk '{print $1}' | xargs git branch -d #Use capital D for hard remove
git branch -vv | grep 'origin/.*: gone]' #This lists the branches that will be removed.
git reset --hard origin/<branch_name>
git tag --list
git tag --list | grep xxx
git tag -d xxx # deleting tag locally
git push origin :refs/tags/xxx # deleting tag on remote