Fix git loose object corrupt


To fix the following error: fatal: loose object cbcaa4621da26a9ca57e97d797c6df867c824173 (stored in .git/objects/cb/caa4621da26a9ca57e97d797c6df867c824173) is corrupt

rm -fr .git
git init
git remote add origin [repo-url]
git fetch
git reset --mixed origin/master
git branch --set-upstream-to=origin/master master

Example repo-url: https://[user]@bitbucket.org/[user]/[repo].git

Notes 

See also