You might be needing a cleanup:
git gc --prune=now
or you might be needing a prune:
git remote prune public
prune
Deletes all stale tracking branches under <name>. These stale branches have already been removed from the remote repository referenced by <name>, but are still locally available in "remotes/<name>".
With --dry-run option, report what branches will be pruned, but do no actually prune them.
However, it appears these should have been cleaned up earlier with
git remote rm public
rm
Remove the remote named <name>. All remote tracking branches and configuration settings for the remote
are removed.
So it might be you hand-edited your config file and this did not occur, or you have privilege problems.
Maybe run that again and see what happens.
Advice Context
If you take a look in the revision logs, you'll note I suggested more "correct" techniques, which for whatever reason didn't want to work on their repository.
I suspected the OP had done something that left their tree in an inconsistent state that caused it to behave a bit strangely, and git gc
was required to fix up the left behind cruft.
Usually git branch -rd origin/badbranch
is sufficient for nuking a local tracking branch , or git push origin :badbranch
for nuking a remote branch, and usually you will never need to call git gc
git remote prune [remote-name]
orgit fetch -p [remote-name]
not work in your scenario? Doing it withgit gc
is a lot more forceful than is normally needed. – Photinagit remote prune [remote-name]
won't work with git svn, although neither doesgit gc
...git branch -rd origin/name
does work though. @Casey, you probably should select the second answer -it's slightly less dangerous. – Filtrationmaster
...particularly when deleting on the remote. – Harrietteharrigancomputer1
andcomputer2
. Oncomputer2
, I addedcomputer1
as a remote, and then didgit push computer2 --mirror
. Now oncomputer1
, I have branches of theremotes/computer1/branchname
form even though (quite understandably) it is not tracking itself as a remote. – Jeunesse