Two git config lines that make status incremental
Setting core.fsmonitor and core.untrackedCache makes git status check only what changed instead of walking the whole worktree.
By default, git status, git add, and git diff walk the entire worktree and stat every file. Two config lines turn that into an incremental check: core.fsmonitor starts a built-in daemon that watches the filesystem, and core.untrackedCache caches the untracked-file scan so it only rechecks directories that changed. They compound.
Note
Tested with Git 2.56.0 on macOS on 2026-09-30.
Usage
# .gitconfig
[core]
fsmonitor = true
untrackedCache = true
Verify the daemon picked the repository up:
$ git fsmonitor--daemon status
fsmonitor-daemon is watching '/Users/fran/src/monorepo'
The daemon starts lazily on the first status call and runs detached, one per repository.
Notes
The commands that trigger full worktree scans run constantly in my setup: lazygit in a terminal split, gitsigns refreshing per buffer in Neovim, worktree previews, and branch cleanup helpers. On monorepos those scans are the slow part; here they only check what the daemon reports as modified.
Honest numbers: on a 204-file repository both paths measured 0.00s. The setting earns its place on large worktrees, not small ones.
One gotcha while setting this up: git config core.fsmonitor --get writes --get as the value instead of reading it, because the flag belongs before the key. Symptoms were error: cannot run --get on every status until I unset it with git config --unset core.fsmonitor.
Git 2.55 extended the built-in daemon to Linux (inotify), which is what prompted me to check mine; on macOS it has been built in since Git 2.37, and I simply never had it on.
References
- git-config documentation: core.fsmonitor and core.untrackedCache reference
- What’s new in Git 2.55.0?: fsmonitor Linux support that prompted this
This post was written with AI assistance.