commit 4ffe89068e1155e1012e126c8342b703980e3348
parent a7041e4a752b817782244d3f4615baaa8c2d7566
Author: Erik Loualiche <[email protected]>
Date: Sun, 8 Mar 2026 15:27:34 -0400
docs: document include filter in README
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Diffstat:
1 file changed, 23 insertions(+), 0 deletions(-)
diff --git a/README.md b/README.md
@@ -177,6 +177,10 @@ watcher_debounce = 500
# Run a full sync when esync starts (default: false)
initial_sync = false
+# Path prefixes to sync, relative to local. Empty means everything.
+# Keep include simple and explicit; use ignore for fine-grained filtering.
+include = []
+
# Patterns to ignore — applied to both the watcher and rsync --exclude flags.
# Supports glob patterns. Matched against file/directory base names.
ignore = [
@@ -283,6 +287,25 @@ extra_args = [
]
```
+### Include Filters (Monorepo Support)
+
+In a large repo, you may only want to sync specific subtrees. Use `include` to name the directories you care about, then use `ignore` for fine-grained filtering within them:
+
+```toml
+[sync]
+local = "/home/user/monorepo"
+remote = "server:/opt/monorepo"
+
+[settings]
+include = ["src", "docs/api"]
+ignore = [".git", "node_modules", ".DS_Store"]
+```
+
+- `include` takes path prefixes relative to `local` (not globs)
+- Empty `include` (the default) means sync everything — fully backwards compatible
+- When set, only files under the listed prefixes are watched and synced
+- `ignore` then further refines within the included paths
+
### Separate Watcher and Rsync Ignore Patterns
The top-level `settings.ignore` patterns are used by both the file watcher and rsync. If you need rsync-specific excludes (patterns the watcher should still see), use `settings.rsync.ignore`: