Delete Remote Branch
To delete a local branch, git branch -d <branch-name>
(or with -D
to force remove unmerged branches) works. However, it won't delete the remote branch, or the local remote-tracking branch.
To delete a remote branch:
git push <remote> -d <branch-name> # Git version 1.7.0 or newer
git push <remote> :<branch-name> # Git versions older than 1.7.0
To delete local remote-tracking branch:
git branch -dr <remote>/<branch> # -d for delete, -r for remote
To delete multiple obsolete remote-tracking branches:
git fetch <remote> --prune