So last week, our git server was having issues and something got corrupted. Whenever I tried to fetch, I would get the following error message:
fatal: internal server error remote: internal server error fatal: protocol error: bad pack header
No amount of
git fsck or
git gc would fix the issue. The remote (gerrit) server was fixed, but was still some kind of unfixable corruption in my local objects.
The solution that other co-workers made was to make a completely new clone of the repository, but I didn't want to bother with the extra work that would entail, so I did this instead:
cp .git/config .git/config.backup git remote remove origin mv .git/config.backup .git/config git fetch