Add another machine
-
Install dotsync, and make sure
gitreaches your repository without any prompt:Terminal window git ls-remote git@github.com:you/dotfiles.git -
Connect the machine:
Terminal window dotsync init git@github.com:you/dotfiles.gitinitclones the repository, installs every managed file, copies the binary to~/.local/binand starts the background agent. It’s safe to run again. -
Check the result:
Terminal window dotsync doctor # git access, the agent, the last syncdotsync status # every managed file
Files the machine already has
Section titled “Files the machine already has”A machine often has its own version of a managed file already: a distribution’s default .bashrc, or an old .gitconfig. You choose what happens to it:
| This machine has… | dotsync init <url> |
dotsync init --keep-existing <url> |
|---|---|---|
| no such file | the shared version is installed | the shared version is installed |
| an identical file | it’s left as it is | it’s left as it is |
| a different file | it’s backed up, then replaced by the shared version | it’s left untouched and reported as a conflict |
The default gets a new machine consistent without asking you anything, and nothing is lost: every replaced file is in ~/.local/state/dotsync/backups/. Choose --keep-existing when the machine has changes you want to review file by file, then resolve each conflict.
A file that exists only on this machine, in a spot the manifest manages but the repository has nothing for yet, is sent to the repository.
A machine that shouldn’t get everything
Section titled “A machine that shouldn’t get everything”- Entries limited to another operating system, like
"os": ["darwin"]on a Linux machine, are skipped automatically. - To skip an entry on this machine only, run
dotsync exclude <entry>here.
See Per-OS and per-machine differences.
Options for init
Section titled “Options for init”| Flag | Use it to |
|---|---|
--keep-existing |
turn differing existing files into conflicts, as above |
--branch <name> |
sync a branch other than main |
--interval <seconds> |
sync more or less often than every 300 seconds |
--no-agent |
skip the background agent, if you’ll run dotsync sync -q from your own scheduler |
--no-install |
leave the binary where it is instead of copying it to ~/.local/bin |
Retiring a machine
Section titled “Retiring a machine”There’s nothing to undo on the others. On the old machine, uninstall dotsync, or just wipe it. Its commits stay in the repository’s history.