Junio C Hamano | e80e7b5 | 2022-04-07 22:10:10 | [diff] [blame] | 1 | git-fsmonitor{litdd}daemon(1) |
| 2 | ============================= |
Junio C Hamano | 4bea028 | 2022-04-04 18:21:49 | [diff] [blame] | 3 | |
| 4 | NAME |
| 5 | ---- |
Junio C Hamano | dac8a36 | 2022-10-17 22:25:51 | [diff] [blame] | 6 | git-fsmonitor--daemon - A Built-in Filesystem Monitor |
Junio C Hamano | 4bea028 | 2022-04-04 18:21:49 | [diff] [blame] | 7 | |
| 8 | SYNOPSIS |
| 9 | -------- |
| 10 | [verse] |
Junio C Hamano | e80e7b5 | 2022-04-07 22:10:10 | [diff] [blame] | 11 | 'git fsmonitor{litdd}daemon' start |
| 12 | 'git fsmonitor{litdd}daemon' run |
| 13 | 'git fsmonitor{litdd}daemon' stop |
| 14 | 'git fsmonitor{litdd}daemon' status |
Junio C Hamano | 4bea028 | 2022-04-04 18:21:49 | [diff] [blame] | 15 | |
| 16 | DESCRIPTION |
| 17 | ----------- |
| 18 | |
| 19 | A daemon to watch the working directory for file and directory |
Junio C Hamano | dac8a36 | 2022-10-17 22:25:51 | [diff] [blame] | 20 | changes using platform-specific filesystem notification facilities. |
Junio C Hamano | 4bea028 | 2022-04-04 18:21:49 | [diff] [blame] | 21 | |
| 22 | This daemon communicates directly with commands like `git status` |
| 23 | using the link:technical/api-simple-ipc.html[simple IPC] interface |
| 24 | instead of the slower linkgit:githooks[5] interface. |
| 25 | |
| 26 | This daemon is built into Git so that no third-party tools are |
| 27 | required. |
| 28 | |
| 29 | OPTIONS |
| 30 | ------- |
| 31 | |
| 32 | start:: |
| 33 | Starts a daemon in the background. |
| 34 | |
| 35 | run:: |
| 36 | Runs a daemon in the foreground. |
| 37 | |
| 38 | stop:: |
| 39 | Stops the daemon running in the current working |
| 40 | directory, if present. |
| 41 | |
| 42 | status:: |
| 43 | Exits with zero status if a daemon is watching the |
| 44 | current working directory. |
| 45 | |
| 46 | REMARKS |
| 47 | ------- |
| 48 | |
| 49 | This daemon is a long running process used to watch a single working |
| 50 | directory and maintain a list of the recently changed files and |
| 51 | directories. Performance of commands such as `git status` can be |
| 52 | increased if they just ask for a summary of changes to the working |
| 53 | directory and can avoid scanning the disk. |
| 54 | |
| 55 | When `core.fsmonitor` is set to `true` (see linkgit:git-config[1]) |
| 56 | commands, such as `git status`, will ask the daemon for changes and |
| 57 | automatically start it (if necessary). |
| 58 | |
| 59 | For more information see the "File System Monitor" section in |
| 60 | linkgit:git-update-index[1]. |
| 61 | |
| 62 | CAVEATS |
| 63 | ------- |
| 64 | |
| 65 | The fsmonitor daemon does not currently know about submodules and does |
Junio C Hamano | dac8a36 | 2022-10-17 22:25:51 | [diff] [blame] | 66 | not know to filter out filesystem events that happen within a |
Junio C Hamano | 4bea028 | 2022-04-04 18:21:49 | [diff] [blame] | 67 | submodule. If fsmonitor daemon is watching a super repo and a file is |
| 68 | modified within the working directory of a submodule, it will report |
| 69 | the change (as happening against the super repo). However, the client |
| 70 | will properly ignore these extra events, so performance may be affected |
| 71 | but it will not cause an incorrect result. |
| 72 | |
Junio C Hamano | 33be821 | 2023-10-23 21:45:54 | [diff] [blame] | 73 | By default, the fsmonitor daemon refuses to work with network-mounted |
Junio C Hamano | dac8a36 | 2022-10-17 22:25:51 | [diff] [blame] | 74 | repositories; this may be overridden by setting `fsmonitor.allowRemote` to |
| 75 | `true`. Note, however, that the fsmonitor daemon is not guaranteed to work |
Junio C Hamano | 33be821 | 2023-10-23 21:45:54 | [diff] [blame] | 76 | correctly with all network-mounted repositories, so such use is considered |
Junio C Hamano | dac8a36 | 2022-10-17 22:25:51 | [diff] [blame] | 77 | experimental. |
| 78 | |
| 79 | On Mac OS, the inter-process communication (IPC) between various Git |
| 80 | commands and the fsmonitor daemon is done via a Unix domain socket (UDS) -- a |
| 81 | special type of file -- which is supported by native Mac OS filesystems, |
| 82 | but not on network-mounted filesystems, NTFS, or FAT32. Other filesystems |
| 83 | may or may not have the needed support; the fsmonitor daemon is not guaranteed |
| 84 | to work with these filesystems and such use is considered experimental. |
| 85 | |
Junio C Hamano | 33be821 | 2023-10-23 21:45:54 | [diff] [blame] | 86 | By default, the socket is created in the `.git` directory. However, if the |
| 87 | `.git` directory is on a network-mounted filesystem, it will instead be |
Junio C Hamano | dac8a36 | 2022-10-17 22:25:51 | [diff] [blame] | 88 | created at `$HOME/.git-fsmonitor-*` unless `$HOME` itself is on a |
Junio C Hamano | 33be821 | 2023-10-23 21:45:54 | [diff] [blame] | 89 | network-mounted filesystem, in which case you must set the configuration |
Junio C Hamano | dac8a36 | 2022-10-17 22:25:51 | [diff] [blame] | 90 | variable `fsmonitor.socketDir` to the path of a directory on a Mac OS native |
| 91 | filesystem in which to create the socket file. |
| 92 | |
| 93 | If none of the above directories (`.git`, `$HOME`, or `fsmonitor.socketDir`) |
| 94 | is on a native Mac OS file filesystem the fsmonitor daemon will report an |
| 95 | error that will cause the daemon and the currently running command to exit. |
| 96 | |
| 97 | CONFIGURATION |
| 98 | ------------- |
| 99 | |
| 100 | include::includes/cmd-config-section-all.txt[] |
| 101 | |
| 102 | include::config/fsmonitor--daemon.txt[] |
| 103 | |
Junio C Hamano | 4bea028 | 2022-04-04 18:21:49 | [diff] [blame] | 104 | GIT |
| 105 | --- |
| 106 | Part of the linkgit:git[1] suite |