website/docs/cmd/watch.md
Deprecated starting in version 3.1. We recommend that clients adopt the watch-project command.
Requests that the specified dir is watched for changes. Watchman will track all files and dirs rooted at the specified path.
From the command line:
$ watchman watch ~/www
Note that, when you're using the CLI, you can specify the root as ~/www
because the shell will resolve ~/www to /home/wez/www, but when you use the
JSON protocol, you are responsible for supplying an absolute path.
JSON:
["watch", "/home/wez/www"]
Watchman will realpath(3) the directory and start watching it if it isn't
already. A newly watched directory is processed in a couple of stages:
Unless the --no-save-state server option was used to start the watchman
service, watches and their associated triggers are saved and re-established
across a process restart.
Watchman has the following level of support for case-insensitive filesystems, starting in version 2.9.9 on macOS only:
match and
pcre query expression terms request case folding support from the containing
library, and that their case folding behavior is not controlled by Watchman
beyond being enabled when the root is case-insensitive.path generator is always case sensitive.