Last active
September 15, 2017 08:36
-
-
Save zucchinidev/5a1963f1c42c734b7b969d27e116c19c to your computer and use it in GitHub Desktop.
Git: “Corrupt loose object”
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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