Created
February 11, 2020 08:30
-
-
Save chaudharisuresh997/1333f678f90d69db2b8262fc363530d9 to your computer and use it in GitHub Desktop.
Git loose oebject error
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
https://stackoverflow.com/questions/4254389/git-corrupt-loose-object | |
Your best bet is probably to simply re-clone from the remote repo (ie. Github or other). Unfortunately you will lose any unpushed commits and stashed changes, however your working copy should remain intact. | |
First make a backup copy of your local files. Then do this from the root of your working tree: | |
rm -fr .git | |
git init | |
git remote add origin [your-git-remote-url] | |
git fetch | |
git reset --mixed origin/master | |
git branch --set-upstream-to=origin/master master | |
Then commit any changed files as necessary. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment