Remove a branch locally:
To remove a branch locally the command is:
$ git branch -D <branch-name>
Rename a branch:
Rename your local branch. If you are on the branch you want to rename:
$ git branch -m <new-name>
Delete the old-name remote branch and push the new-name local branch:
$ git push origin :old-name new-name
Reset the upstream branch for the new-name local branch Switch to the branch and then:
$ git push origin -u new-name.
*Refer my old post for switching between branches
Remove branches that are not in remote:
You might have some branches locally that other members of your team have remote it remote. To get rid of those branches run:
$ git remote prune origin