Git error when pushing (remote failed to report status)
It appears that i had to many references (~9000). Removing most of them fixed the issue
I had this exact error with a very large (22Gb) mirror cloned repo that I was asked to import into our GitHub enterprise server.
git gc
helped as it reduced the size of the repo to a mere 7Gb but I still could not push it because there were ~13k tags (and apparently every one was vital!) which were listed as errors in the same way as the OP reports.
The solution is to push the tags in smaller blocks e.g.
git push refs/tags/tag-2015* git@my_server:my_org/my_repo
You can put this into a loop and push all the tags in blocks e.g.
for n in {15..20}; do git push refs/tags/tag-20${n}* git@my_server:my_org/my_repo; done
Now when you do the original push --mirror
those tags will already be present on the remote and you will not get the error.
Before getting to that I also pushed the branches in a similar way but as that didn't solve the issue I don't think it mattered. However incase it was relevant this is how you switch to each branch in a bare repo and push it.
git branch -a --format "%(refname)" | xargs -i bash -c "git symbolic-ref HEAD {} && git push git@my_server:my_org/my_repo"
This may be a myth but the reason I was given for this error is that git has some hidden limits deep within it. In this case there is a restriction on pushing tags where the whole operation must complete within 5 minutes. Hence breaking up the process works.
Running git gc
resolved this for me. This will do some garbage-collecting housekeeping tasks which could be causing this issue.