Introduction
The index is the file in which Git keeps the staging
area: the list of paths that will make up the next commit, with their object names and
file details. It is a file called index, with no extension, in the
.git folder.
Structure
The file is binary and big-endian. A 12-byte header holds the signature
DIRC, a version (2, 3 or 4) and the number of entries. The entries follow,
sorted by path, then optional extensions, each with a 4-byte signature and a size, then
a checksum of the whole file.
Not described
Known, not yet covered
- Reference: this page is a summary; the entry fields, versions and extensions are not yet described on this site.
- Viewer: the site has no viewer for Git index files.
Links
Software
- Git – writes and reads the index
Reference
- gitformat-index – Git’s own description of the index format