Receiving "core.useBuiltinFSMonitor will be deprecated soon" message while cloning in Git

Viewed 12662

I recently installed git version 2.36.0.windows.1 and upon cloning a repo I got the following messages after.

hint: core.useBuiltinFSMonitor will be deprecated soon; use core.fsmonitor instead

hint: Disable this message with "git config advice.useCoreFSMonitorConfig false"

Changing the value to false does disable the message.

My questions are:

  1. What are core.useBuiltinFSMonitor and core.fsmonitor ?
  2. Considering I just installed Git, why isn't the value auto set to false rather than ask the user to do so?

Thanks!


Edit: Put my earlier edit as a separate answer down below.

3 Answers

Thanks to Chris for the explanation and links to look around.

TL;DR

One can safely use the command git config --global core.fsmonitor true to get rid of the message for good.

The answer to the what is in Chris's answer and to why is below.


  1. Seems like both of them are interconnected and hence they haven't yet disabled one.

The new FSMonitor feature is controlled by the core.useBuiltinFSMonitor boolean. Link

  1. In a recent post they seemed to have addressed this issue.

So I understand that the builtin FS monitor is not actually deprecated, just that the name in the config is going to change, is there, on the current version, any way to use the new name or is the only way to get rid of the message to disable it via the provided command?

I guess we should clarify by saying core.useBuiltinFSMonitor=true was experimental, please set core.fsmonitor=true` instead. Link

  1. And finnaly, the reason for the prompt:

With the feature going upstream into core Git, a decision was made to overload the existing core.fsmonitor setting to take a hook-pathname or a boolean value for the builtin FSMonitor. However, users may have multiple versions of Git installed on their systems on Windows. One in the C:/program files/... and hidden versions installed by tools like Visual Studio. And these may be at different revision levels, so one install might only understand the old keyword and one version might understand both (during the transition). So, auto transitioning it would break whichever one is the older release. So it's safer to just warn the user and let them decide. (And if they know they have multiple versions, they can just set both for now.) Link

The release notes for Git for Windows 2.30.2 (March, 2021) offer some clues:

Git for Windows now ships with an experimental built-in file-system monitor, without the need to install Watchman and setting core.fsmonitor. It can be turned on by setting both feature.manyFiles=true and feature.experimental=true (or directly, via core.useBuiltinFSMonitor=true).

core.useBuiltinFSMonitor is not documented on the Git website, even on an older version where it should exist, but it appears to have been a setting to enable the built-in filesystem monitor for users who want to live on the bleeding edge.

The hints you quote in your question suggest that this feature is now considered stable enough to be the default. Indeed, if we look at the documentation for core.fsmonitor, we see that this is the case¹:

If set to true, enable the built-in file system monitor daemon for this working directory

(The older documentation reveals that this setting did exist prior to this change, but it was used for pointing to an external command to use as a monitor.)

The documentation also explains why we might want a filesystem monitor in the first place, and why a built-in monitor is preferable:

Like hook-based file system monitors, the built-in file system monitor can speed up Git commands that need to refresh the Git index (e.g. git status) in a working directory with many files. The built-in monitor eliminates the need to install and maintain an external third-party tool.

As to why you're getting this warning when you clone, I'm not sure. Did you already have a global .gitconfig file in your home directory? Possibly one that your employer ships as part of a default configuration?


¹At the time of writing, this feature is documented to be available only on Windows and macOS.

The Short solution - for Windows users - to get rid of the message:

  • Edit file C:\Program Files\Git\etc\gitconfig

  • Add line in section:

    [core]

    fsmonitor = true

  • Save file with elevated priv

Related