One of my repositories got corrupted. I am not exactly sure how it happened (was running a series of commands) but I think I accidentally ran regular mv instead of git mv. To fix it I deleted the moved file then checkout the original link however this did not fixed the problem. I ended up with a corrupted repo. Now running any command ends with the following error,
ga sync
(merging origin/git-annex origin/synced/git-annex into git-annex...)
(Recording state in git...)
error: invalid object 040000 6ad564920e3d78d31c9456f5be3869a0319f9f08 for'3fd/d44'
fatal: git-write-tree: error building trees
git-annex: failed to read sha from git write-tree
Was wondering how to fix this? I did run git fsck and git annex fsck but non fixed the problem.
git is complaining about one of the files in
.git/objects
being missing or corrupt.It's not likely that some accidental command you ran caused this. More likely a disk error or an unclean shutdown could have left the repository in this state.
You can try running
git annex repair
which should be able to repair git repositories with this kind of damage.Or you can just
git clone
the repository from any other place you have it and move over .git/annex/objects and .git/config to the new repository, discarding the damaged one.