Strange GIT error: non-monotonic index

It’s been a while since I’ve posted so let me start by saying Hello!

First, let me describe my setup:

[ul][li]PC_A (Win7) = Clones from Github via internet. This is my local “master repo”. I push from my LAN to here and then from here out to github.[/li][li]PC_B (Win7) = Clones from PC_A via lan. This is my dev. machine where the server runs and is not connected to the internet.[/li][li]Using Git for Windows[/li][li]Using TortoiseGit for my cloning, push, sync, etc. (basically all my GIT functions)[/li][li][SIZE=12px]NOTE: I did update both GIT and TortoiseGit after the error occurred but it didn’t fix the problem[/SIZE][/li][/ul]
I was going to work a little bit on “pets on transports” when I ran into this strange GIT error when I tried to commit to my local repo:

error: non-monotonic index .git/objects/pack/pack-037de7c15f9d6483a5f487c6a1394d214bdc5f38.idx

This error repeated several hundred times with different values for .idx. Now I have several clones on PC_B (mainly old revisions of Trinity that I haven’t got around to deleting) but all of them give this error even when I attempt to view the GIT log.

Is there any way to recover this repo or is it broken beyond repair?

Thanks!

hi,

non-monolitic error link:http://git.661346.n2.nabble.com/Error-non-monotonic-index-after-failed-recursive-quot-sed-quot-command-td7575014.html (no need to read if you dont want to go through the entire thread)
TL;DR: you remove the non-monolotic index and then reindex it. In linux it would be:

rm .git/objects/pack/pack-.idx (del in windows unless you have git with linux tools installed on your windows)
git index-pack .git/objects/pack/pack-
.pack
After this git gc --prune=now and git remote prune origin

back up the repo first before you attempt anything.

should be easy to fix.

Thanks, ravensnow.

The reindex also failed with similar errors. I think I had a few bad sectors, chkdsk found a couple filesystem errors. Forutnately I had already exported my code as DIFFs so I ended up just nuking the whole repo.