Edit: The below description is of course still accurate, but it should be noted that Magit now falls back to deleting just the local remote-tracking ref if the respective branch does not actually exist on the remote anymore.
Pulling out the relevant information from the question comments:
Magit does not provide a direct equivalent of
git branch -D -r <remote>/<branch>.
--prune flag from the fetch popup (by default, f-p)
can be used instead to delete all stale remote-tracking for a
I believe that Magit doesn't provide a command for
git branch -D -r
because it is the assumed that it would be rare for a user to want to
delete a single stale remote-tracking branch but not prune other stale
remote-tracking branches for that remote.
If the branch does still exist on a remote, k will run
git push <remote> :<branch>, deleting the branch on the remote and
cleaning up the local remote-tracking branch. So, provided that
the branch hasn't been deleted from the remote in some other way
(e.g., through GitHub's web interface or by running
git push <remote> :<branch>
from another machine), this command is all you need to run (at least
until you get on another machine and want to prune the remote-tracking
git push <remote> :<branch>,
git branch -D -r <remote>/<branch>
is not sufficient to delete the branch on the remote. This is
Use -r together with -d to delete remote-tracking branches. Note, that it only makes
sense to delete remote-tracking branches if they no longer exist in the remote
repository or if git fetch was configured not to fetch them again. See also the prune
subcommand of git-remote(1) for a way to clean up all obsolete
The example below shows what the above quote is talking about. If you
git branch -D -r, the local remote-tracking branch will
deleted just to be recreated on the next fetch.
# Repo setup
git init --bare
echo text > some-file
git add some-file
git commit -m"Add some file"
git checkout -b feat master
echo text > feat-file
git add feat-file
git commit -m"Add feature file"
git remote add origin ../remote-repo
git push origin feat master
# branch -D -r test
git branch -D -r origin/feat
git fetch origin
git push origin :feat (or, in Magit, k and then
origin/feat) will get rid of the branch in both places.
git push origin :feat
git fetch origin