I randomly hit this today while trying to run Git garbage collect:
$ git gc fatal: bad object refs/remotes/origin/HEAD error: failed to run repack
Looks like your symbolic-refs might be broken... Try the replacing it with your default branch like this: For example, my default branch is master
$ git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/master $ git fetch --prune $ git gc
That should fix it.