git remote prune
and git fetch --prune
do the same thing: deleting the refs to the branches that don't exist on the remote, as you said. The second command connects to the remote and fetches its current branches before pruning.
However it doesn't touch the local branches you have checked out, that you can simply delete with
git branch -d random_branch_I_want_deleted
Replace -d
by -D
if the branch is not merged elsewhere
git prune
does something different, it purges unreachable objects, those commits that aren't reachable in any branch or tag, and thus not needed anymore.