Skip to content

Instantly share code, notes, and snippets.

@zucchinidev
Last active September 15, 2017 08:36
Show Gist options
  • Save zucchinidev/5a1963f1c42c734b7b969d27e116c19c to your computer and use it in GitHub Desktop.
Save zucchinidev/5a1963f1c42c734b7b969d27e116c19c to your computer and use it in GitHub Desktop.
Git: “Corrupt loose object”
# Create a backup of the corrupt directory:
cp -R foo foo-backup
# Make a new clone of the remote repository to a new directory:
git clone git@www.mydomain.de:foo foo-newclone
# Delete the corrupt .git subdirectory:
rm -rf foo/.git
# Move the newly cloned .git subdirectory into foo:
mv foo-newclone/.git foo
# Delete the rest of the temporary new clone:
rm -rf foo-newclone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment