Tracking Files
How to register files and directories as sync targets, and how they are mirrored in the repository.
Before devsync can sync a file, you need to track it. Tracking registers the path in manifest.json so devsync knows to include it during push and pull.
Tracking a Single File
Section titled “Tracking a Single File”devsync track ~/.gitconfigdevsync track ~/.zshrcAfter tracking, run devsync push to mirror the file into the sync repository.
Tracking a Directory
Section titled “Tracking a Directory”You can track an entire directory. All files inside it, recursively, will be included during push and pull.
devsync track ~/.config/nvimdevsync track ~/.config/fishTracking Multiple Paths at Once
Section titled “Tracking Multiple Paths at Once”Pass multiple paths in a single command:
devsync track ~/.gitconfig ~/.zshrc ~/.config/nvimAll entries are created with the same mode and profile options provided in that command.
Tracking with a Mode
Section titled “Tracking with a Mode”By default, files are tracked in normal mode. To use a different mode:
devsync track ~/.ssh/config --mode secretdevsync track ~/.config/local-only --mode ignoreSee Sync Modes for a full explanation of each mode.
Tracking with a Profile
Section titled “Tracking with a Profile”To assign a file to one or more profiles, use --profile:
devsync track ~/.config/work-tool --profile workdevsync track ~/.config/nvim --profile work --profile personalEntries with no profile are always included during push and pull, regardless of the active profile.
See Profiles for more details.
How Files Are Mirrored in the Repository
Section titled “How Files Are Mirrored in the Repository”When you run devsync push, tracked files are copied into the sync directory using a path structure that mirrors their location relative to your home directory.
For example:
| Local path | Repository artifact |
|---|---|
~/.gitconfig | sync/default/.gitconfig |
~/.config/nvim/init.lua | sync/default/.config/nvim/init.lua |
~/.ssh/config (secret) | sync/default/.ssh/config.devsync.secret |
The default segment is the profile namespace. Entries assigned to a profile named work would be stored under sync/work/.
Directory~/.config/devsync/sync/
- manifest.json
Directorydefault/
- .gitconfig
- .zshrc
Directory.config/
Directorynvim/
- init.lua
Directory.ssh/
- config.devsync.secret
Directorywork/
Directory.config/
Directorywork-tool/
- settings.json
Untracking a File
Section titled “Untracking a File”To stop tracking a file, use devsync untrack:
devsync untrack ~/.gitconfigThis removes the entry from manifest.json. It does not delete the local file or the existing artifact in the sync repository. You can remove the artifact manually with devsync cd if needed.
Checking What Is Tracked
Section titled “Checking What Is Tracked”Use devsync status to see the current state of all tracked entries — what has changed since the last push, what is new, and what has been deleted:
devsync statusUse --dry-run with push or pull to preview what would be written without actually applying anything:
devsync push --dry-rundevsync pull --dry-run