If you want to delete a branch, first checkout to the branch other than the branch to be deleted.
git checkout other_than_branch_to_be_deleted
Deleting the local branch:
git branch -D branch_to_be_deleted
Deleting the remote branch:
git push origin --delete branch_to_be_deleted