Par Anonyme (non vérifié) , 29 avril 2026

La config tout-en-un

En assemblant les morceaux : c'est une configuration unique qui applique la pile moderne de performance de Git. Déposez-la dans .git/config sur un clone frais, exécutez les tâches uniques et vous avez la config recommandée pour repos avec centaines de milliers de fichiers et historique actif.

Le bloc de config

[feature]
manyFiles = true
[core]
fsmonitor = true
untrackedCache = true
commitGraph = true
multiPackIndex = true
preloadIndex = true
[index]
version = 4
sparse = true
[fetch]
parallel = 0
writeCommitGraph = true
negotiationAlgorithm = skipping
showForcedUpdates = false
[gc]
auto = 0
writeCommitGraph = true
[maintenance]
auto = false
[checkout]
workers = 0
thresholdForParallelism = 100
[pack]
useSparse = true
writeBitmaps = true
threads = 0
windowMemory = 256m
[commitGraph]
changedPathsVersion = 2
[diff]
algorithm = histogram
[merge]
conflictStyle = zdiff3
[rebase]
autoSquash = true
autoStash = true
updateRefs = true
[push]
autoSetupRemote = true
[protocol]
version = 2

Tâches uniques

# Activer setup sparse, partial-clone-friendly
git sparse-checkout init --cone --sparse-index
git sparse-checkout set apps/web libs/shared

# Construire les artefacts de performance
git commit-graph write --reachable --changed-paths
git multi-pack-index write --bitmap
git update-index --index-version 4
git pack-refs --all

# Démarrer la maintenance en arrière-plan
git maintenance start

Vérification

git config --list --show-origin | sort
git maintenance status
git fsmonitor--daemon status
git-sizer --no-progress
GIT_TRACE2_PERF=1 git status

Notes par plateforme

  • Linux : élever fs.inotify.max_user_watches à 524288+.
  • macOS : rien d'extra ; FSEvents gère nativement les énormes arbres.
  • Windows : exclure l'arbre de travail du scan AV temps réel.
  • WSL2 : fonctionne ; WSL1 non.

Notes par équipe

Documentez ceci dans CONTRIBUTING.md du repo. Épinglez une version Git (2.39+ recommandée).

Erreurs courantes

Appliquer toutes les configs d'un coup sans mesurer.