Hi all, To reduce traffic, we use local mirrors via "git clone --reference mirror ..." commands. And we regularly get problems with update of few weeks old clones and must run something like below to get rid of outdated branches: git for-each-ref --format="%(refname)" | while read ref; do git show-ref --quiet --verify $ref 2>/dev/null || git update-ref -d $ref done This can be quite long operation as number of refs is significant. Details are below. Thanks, Oleg. Thank you for filling out a Git bug report! Please answer the following questions to help us understand your issue. What did you do before the bug happened? (Steps to reproduce your issue) $ cat ./doit #!/bin/sh set -xe rm -rf tst mkdir tst cd tst mkdir master git -C master init --bare git clone master local touch local/foo git -C local add . git -C local commit -m init-commit git -C local push echo foo > local/foo git -C local commit -a -m dummy-commit git -C local push origin HEAD:refs/heads/dummy git clone --mirror file://`pwd`/master mirror git clone --reference `pwd`/mirror file://`pwd`/master local1 git -C local1 log --oneline origin/dummy git -C local commit --amend -m new-dummy-commit git -C local push -f origin HEAD:dummy git -C mirror fetch git -C mirror gc --prune=now git -C local1 fetch git -C local1 log --oneline origin/dummy What did you expect to happen? (Expected behavior) No errors; last few lines like: + git -C local1 fetch