GuideJune 24, 20255 min read

Watch Mode: Never Forget to Push Your Config Changes Again

You tweaked your .zshrc, forgot to push, switched machines, and got the old version. Watch mode makes sure that never happens again.

The Problem: Forgetting to Push

Every developer who syncs config files has experienced this: you spend fifteen minutes perfecting a shell alias on your desktop. You head to your laptop. The alias is not there. You forgot to push.

The manual push workflow has a fundamental flaw: it relies on you remembering to run a command after every config change. Config tweaks happen in the middle of other work — you are debugging a build, you adjust an environment variable, you move on. The push never happens.

How Watch Mode Works

Start watch mode with a single command:

Start watching
configsync watch

ConfigSync monitors every tracked file using filesystem watchers. When a file changes, it computes a content hash and compares it to the last known state. If the content actually changed, it waits for a debounce period (default 5 seconds) and then pushes only the changed files.

The content hashing is important. Many editors touch files without changing their content — saving without modifications, auto-formatting that produces identical output, or backup processes that update timestamps. Watch mode ignores these false positives. Only real content changes trigger a push.

Smart Debouncing

When you are actively editing a file, you do not want a push after every keystroke. The debounce timer resets on each change, so rapid edits are batched into a single push:

Custom debounce interval
# Default: 5 seconds after last change configsync watch # Wait 10 seconds after last change configsync watch --debounce 10000 # Quick sync: push 2 seconds after last change configsync watch --debounce 2000

With the default 5-second debounce, the typical flow is: you save a file, ConfigSync detects the change, waits 5 seconds for more changes, then pushes. If you save again within those 5 seconds, the timer resets. This means batch editing sessions produce a single push at the end.

Filtering What to Watch

If you only want to watch certain modules, use the filter flag:

Watch specific modules
# Watch only shell configs configsync watch --filter modules:zsh,bash # Watch only SSH files configsync watch --filter modules:ssh # Watch only git configuration configsync watch --filter modules:git

Filtering is useful when you are working on a specific part of your config and do not want unrelated file changes triggering pushes. It also reduces the number of filesystem watchers, which matters on machines with many tracked files.

Changed-Only Semantics

Watch mode uses --changed semantics internally. This means it only pushes the files that actually differ from the last snapshot, not your entire configuration. A single-line change to .zshrc pushes only that file, not your entire tracked file set.

Bandwidth friendly: Watch mode minimizes upload size by pushing only changed files. If you have 50 tracked files and change one, only that one file is uploaded. Your sync history stays clean too — each watch-triggered snapshot shows exactly what changed.

Live Status

While running, watch mode displays a live status view:

Watch mode output
$ configsync watch Watching 34 tracked files... [14:23:05] Changed: ~/.zshrc [14:23:10] Pushed 1 file (238 bytes) [14:45:31] Changed: ~/.config/starship.toml [14:45:36] Pushed 1 file (1.2 KB) Press Ctrl+C to stop watching.

Each event shows a timestamp, the file that changed, and the push result. Press Ctrl+C to stop watching. Your last push is always preserved — stopping watch mode does not lose any changes that were already pushed.

When to Use Watch Mode

Watch mode is ideal for developers who frequently tweak their configs throughout the day. Run it in a terminal tab alongside your work and forget about it. Every config change is captured and pushed automatically.

For developers who make config changes infrequently, manual push may still be the better fit. But if you have ever lost a config change because you forgot to push, watch mode eliminates that problem entirely.

Ready to try ConfigSync?

Sync your entire dev environment across machines in minutes. Free forever for up to 3 devices.