Skip to content

Multi-Device Workflow

A complete walkthrough for setting up devsync on your first machine and replicating your config on additional devices.

This guide walks through the full devsync workflow: from initial setup on your first machine, to syncing your config to a second device, to the day-to-day routine of keeping everything in sync.


  1. Install devsync and initialize

    Terminal window
    npm install -g @tinyrack/devsync
    devsync init

    Press Enter when prompted for an age key — a new key pair is generated automatically. Note the private key printed during init and store it securely.

  2. Track your files

    Terminal window
    devsync track ~/.gitconfig
    devsync track ~/.zshrc
    devsync track ~/.config/nvim
    devsync track ~/.ssh/config --mode secret

    Assign machine-specific files to a profile if needed:

    Terminal window
    devsync track ~/.config/work-tool --profile work
    devsync profile use work
  3. Preview what will be pushed

    Terminal window
    devsync status

    Or do a dry run:

    Terminal window
    devsync push --dry-run
  4. Push to the sync repository

    Terminal window
    devsync push
  5. Publish to a remote Git repository

    Terminal window
    devsync cd
    git remote add origin https://github.com/yourname/dotfiles.git
    git add .
    git commit -m "Initial sync"
    git push -u origin main
    exit

Second Machine: Connecting to an Existing Repository

Section titled “Second Machine: Connecting to an Existing Repository”
  1. Install devsync

    Terminal window
    npm install -g @tinyrack/devsync
  2. Initialize with the existing repository and your age private key

    Terminal window
    devsync init https://github.com/yourname/dotfiles.git --key AGE-SECRET-KEY-1...

    This clones the repository into ~/.config/devsync/sync/ and registers your age key.

  3. Set the active profile (if applicable)

    Terminal window
    devsync profile use work
  4. Preview what will be applied

    Terminal window
    devsync pull --dry-run
  5. Apply the config

    Terminal window
    devsync pull

    All tracked files are written to their local paths. Secret files are decrypted automatically.


After the initial setup, the typical daily workflow is:

Terminal window
# 1. Edit your config normally
vim ~/.zshrc
# 2. Preview what changed
devsync status
# 3. Push to the sync repository
devsync push
# 4. Commit and push to git
devsync cd
git add .
git commit -m "Update zsh aliases"
git push
exit
Terminal window
# 1. Pull from git
devsync cd
git pull
exit
# 2. Preview what would be applied
devsync pull --dry-run
# 3. Apply
devsync pull

Because devsync does not auto-commit, conflicts are standard git merge conflicts. If two machines both modified the same tracked file and both pushed:

Terminal window
devsync cd
git pull
# → CONFLICT in .gitconfig (or whichever file)
# Resolve the conflict manually
git add .
git commit -m "Merge: resolve .gitconfig conflict"
exit
# Then pull to apply the resolved state locally
devsync pull

If something seems off, use the doctor command to check your configuration, age key, and tracked paths:

Terminal window
devsync doctor

This reports any issues such as a missing age key, unreachable tracked paths, or a broken manifest.