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
More on Git internals: objects, refs and the index
What are the four object types in Git's object database?BeginnerIs Git a snapshot system or a diff system?BeginnerWhat is the SHA-1 (or SHA-256) hash of an object and how is it computed?BeginnerWhere does Git store objects on disk, and what are loose objects versus packfiles?IntermediateWhat exactly is a branch, and what does creating one cost?IntermediateWhat is HEAD?Beginner