git corruption when trying to add/commit/push - this works for me

find .git/objects -type f -empty -delete

git repack -a -d
git prune

git fetch --all
find .git/objects -type f -empty -delete

git repack -a -d
git prune

git fetch --all
TL:DR it'll clean the files, clean the repo then fetch the code again
1 Reply
Rägnar O'ock
Rägnar O'ock2w ago
rm -rf repo/ git clone repo-url Works wonders too

Did you find this page helpful?