Von Gast (nicht überprüft) , 29 April 2026

Der Staging-Bereich entmystifiziert

Der Index (a.k.a. Cache, Staging-Bereich) lebt unter .git/index als Binardatei.

Inspektion

git ls-files --stage
git ls-files --debug
git diff --cached
git diff

Index-Versionen

git config index.version 4
git update-index --index-version 4

Stat-Caching

Der Index zeichnet device, inode, ctime, mtime, size fur jeden Eintrag auf.

Sparse Index

git sparse-checkout init --cone
git sparse-checkout set apps/web libs/shared
git config core.sparseCheckoutCone true
git config index.sparse true

Drei-Wege-Merge im Index

git ls-files -u
git checkout-index --stage=2 -- file
git checkout-index --stage=3 -- file

Haufige Fehler

Glauben, dass git add Dateien "permanent" staged.

Performance-Hebel

Hebel: index.version=4, core.untrackedCache=true, core.fsmonitor=true, sparse index, feature.manyFiles=true.