Recovering as much history as possible from corrupt git repository
I used photorec
to recover zlib files from a disk image taken just after a git repository was deleted (instructions here). It recovered many (most?) but not all of the contents of the .git/objects
folder. This means I can checkout main
and have all but 1 file (luckily trivial) present, so thankfully the up to date source code still exists, and git log
goes back about ~6 months but eventually it fails to find a parent commit. git gc
and git repack
similarly fail due to missing parent commits.