I've been having issues with one of my git repos deleting all files on commit.
I looked inside the project's .git directory and found a gob of indexes. Check it out:
$ ls .git
COMMIT_EDITMSG index (from Niflheimr - 2)
FETCH_HEAD index (from Niflheimr - 3)
HEAD index (from Niflheimr - 4)
ORIG_HEAD index (from Niflheimr - 5)
config index (from Niflheimr - 6)
description index (from Niflheimr - 7)
github-mac-index index (from Niflheimr - 8)
hooks index (from Niflheimr - 9)
index (from Niflheimr - 10) index (from Niflheimr)
index (from Niflheimr - 11) info
index (from Niflheimr - 12) logs
index (from Niflheimr - 13) objects
index (from Niflheimr - 14) refs
index (from Niflheimr - 15) sequencer
index (from Niflheimr - 16)
I think they're bad and they should go away. I'm not sure what the git way would be to heal this and what I can do to prevent this in the future.