Which repositories get fsmonitor
The shim puts -c core.fsmonitor=true -c core.untrackedCache=true in front of
your arguments when all of these hold, checked in this order:
modeis not"never", the real git is2.55or newer,--bareis not given, and you did not setcore.fsmonitoryourself with-c,--config-env,GIT_CONFIG_PARAMETERSorGIT_CONFIG_KEY_<n>.- The shim finds the repository and its index has a valid header. It walks up
from the working directory, after any
-C, to.git, follows a.gitfile’sgitdir:for a linked worktree, and honors--git-dir,--work-tree,GIT_DIR,GIT_WORK_TREEandGIT_INDEX_FILE. Outside a repository, or with a missing, unreadable or malformed index, git runs without the flags. - No
excludeentry covers the repository. Exclude wins over include. - An
includeentry covers it,modeis"always", or the index holds at leastmin_tracked_filesentries.
An entry covers a repository whose working tree is that path or lies below
it, compared component by component without resolving symlinks, so write
entries the way pwd -P prints them. An entry that covers a repository’s main
working tree also covers its linked worktrees.
The check spawns nothing and reads 12 bytes of the index. On one workstation,
in a release build, it took about 10 µs in a standard repository and 26 µs in a
linked worktree. ADR 0004
has the details.
The flags override a repository’s own core.fsmonitor and
core.untrackedCache, so list a repository that uses an fsmonitor hook such as
Watchman in exclude.