Boost logo

Boost :

Subject: Re: [boost] Cannot add any file to GIT "libgit2 returned: Invalid data in index - invalid entry"
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2015-02-25 08:51:09


On 25 Feb 2015 at 13:04, Paul A. Bristow wrote:

> Cannot add any new file to GIT repo :-(
>
> "libgit2 returned: Invalid data in index - invalid entry"

Yeah you've corrupted your index.

Sometimes you can manually hand edit it back into life, but often
it's easier just to zap it and recreate it. Obviously doing that will
reset your repo, including working directory, back to last good
commit.

A safe alternative is to relocate the corrupted git checkout
elsewhere, clone a new copy in its place, and manually copy over the
changes. No chance of losing anything important that way.

If the same corruption happens a second time, and if you are on
Windows, I'd suggest wiping and reinstalling your all your gits. A
few months ago I had a persistent git index corruption problem on
Windows. git worked fine from mingw, but corrupted outside of mingw.
I did a total purge of all git, msysgit, tortoisegit and mingw from
the system, and reinstalling everything fresh. It fixed the problem,
though it cost me a day of work. I think on Windows we get so many
copies of git that sometimes the versions get mismatched, and this
corruption appears.

Niall

-- 
ned Productions Limited Consulting
http://www.nedproductions.biz/ 
http://ie.linkedin.com/in/nialldouglas/



Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk