Interview Prep/Git & GitHub/Git internals: objects, refs and the index

What information does `.git/index` hold for each file?

IntermediateConceptGit internals: objects, refs and the index
Answer

Per path it stores the mode, blob ID, stage number (0 normally, 1-3 during a conflict), flags, and cached filesystem metadata (mtime, ctime, size, inode). The cached stat data lets git status skip hashing files whose metadata has not changed. Inspect it with plumbing.

git ls-files --stage
git ls-files -u   # unmerged entries only
All Git & GitHub questions Roadmap: Git & GitHub

More on Git internals: objects, refs and the index