All Posts by Date or last 15, 30, 90 or 180 days.

As an Amazon Associate I earn from qualifying purchases @AMAZON

Designed for the most demanding needs of photographers and videographers.
Connect and charge all of your devices through a single Thunderbolt or USB-C port.

Corrupted .git/index File: “git fatal: unordered stage entries in index”

This is a post for geeks like me using the git source code repository.

UDPATE 2021-10-11: all this trouble was really the result of bad memory in the server.

...

Today my web server somehow corrupted its .git/index file, rendering it impossible to pull any updates:

git fatal: unordered stage entries in index

I think I might have hit control-C at the wong time, and git corrupted the index file.

Because the repo is ~364GB, it is not an option to just pull it again! Yes, I know I am abusing git for a massive website—it was never designed for a repo that will soon approach half a terabyte. But as a testament to how well written it is, it has worked great.

I was shitting bricks that this meant a 300 mile drive home, then a visit to the Tier 1 server room in order to manually copy over a fresh/good git repo.

As it turns out, this simple approach worked just fine to rebuild .git/index:

rm .git/index
git reset

After 30 minutes or so, the job was done; git has to read the entire set of pack files totaling ~364GB, so it took a while even on an SSD.

View all handpicked deals...

Seagate 22TB IronWolf Pro 7200 rpm SATA III 3.5" Internal NAS HDD (CMR)
$500 $400
SAVE $100

diglloyd.com | Terms of Use | PRIVACY POLICY
Contact | About Lloyd Chambers | Consulting | Photo Tours
Mailing Lists | RSS Feeds | X.com/diglloyd
Copyright © 2020 diglloyd Inc, all rights reserved.
Display info: __RETINA_INFO_STATUS__