Re: index.skipHash doesn't work with split index, was Re: Bug Report
From: Jeff King <hidden>
Date: 2023-07-03 19:17:04
[re-adding list to cc, so everybody can benefit from the answer] On Mon, Jul 03, 2023 at 07:43:42PM +0100, Tiago d'Almeida wrote:
Meanwhile, just a question: How can I correct the corrupted git repos that are in my computer with unstaged changes?
Probably the best path forward is:
1. Disable one or both of the problematic config options:
git config --global core.splitIndex false
2. Blow away the old index, and have git re-populate it from the HEAD
commit:
rm -f .git/index
git reset
Usually "git reset" would be enough here, but since we don't know
what funny or possibly corrupted state the index file is in,
deleting it first seems wise). Because the default for git-reset is
"--mixed", this won't touch your working tree files at all.
3. You should then be able to run "git status" to see any differences
between the working tree and the fresh index (including any
untracked ones). And now "git add", etc, should work.
-Peff