Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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:

  1. mode is not "never", the real git is 2.55 or newer, --bare is not given, and you did not set core.fsmonitor yourself with -c, --config-env, GIT_CONFIG_PARAMETERS or GIT_CONFIG_KEY_<n>.
  2. 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 .git file’s gitdir: for a linked worktree, and honors --git-dir, --work-tree, GIT_DIR, GIT_WORK_TREE and GIT_INDEX_FILE. Outside a repository, or with a missing, unreadable or malformed index, git runs without the flags.
  3. No exclude entry covers the repository. Exclude wins over include.
  4. An include entry covers it, mode is "always", or the index holds at least min_tracked_files entries.

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.