CLI tool to sync dotfiles, configurations, and folders across multiple Macs using your favorite cloud storage (Dropbox, iCloud, etc.).
Easy sync for macOS. Dotfiles, folders, configs โ anything.
Sync files and folders across Macs using Dropbox, iCloud, Google Drive, OneDrive, Yandex.Disk, NAS, or any folder that syncs between devices.
MacSync moves files to a sync folder and creates symlinks in their place. Edit on one Mac โ changes appear on all others. Works with dotfiles, app configs, scripts, projects โ anything.
Contents
- Contents
- Quick Start
- Sync Modes
- Disabling Sync
- CLI Reference
- How It Works
- Security Considerations
- Troubleshooting
- FAQ
- Requirements
- Changelog
Quick Start
1. Install
brew install pilaton/tap/macsync
Manual installation
git clone https://github.com/Pilaton/MacSync.git ~/.macsync-app
ln -s ~/.macsync-app/bin/macsync /usr/local/bin/macsync
2. Configure โ edit ~/.macsync/config.cfg (created on first run):
# Where to store synced files (must be accessible from all your Macs)
SYNC_FOLDER=~/Dropbox/MacSync
What to sync (paths relative to ~)
BACKUP_FILES=(
.zshrc
.gitconfig
.config/nvim
.ssh/config
)
3. Run
macsync
That's it. Your files are now in the sync folder, symlinked locally.
Sync Modes
flowchart TD
A["$ macsync"] --> B{"What do we do?"}
B --> C["Synchronize my files"]
B --> D["Disable sync"]
C --> E{"dotfiles/ folder exists?"}
E -->|No| F["First sync"]
E -->|Yes| G{"Choose mode"}
G --> H["Replace all files"]
G --> I["Update obsolete files"]
G --> J["Connect only"]
D --> K["Restore files locally"]
Connection options (when dotfiles/ folder exists):
| Option | What happens | When to use | | :----- | :------------ | :---------- | | Replace all files | Deletes the dotfiles/ folder, then uploads your local files fresh | Starting fresh, or when local files are the source of truth | | Update obsolete files | Uploads your local files, overwriting any existing files in sync folder | When you want to add or update files in sync folder | | Connect only | Just creates symlinks to existing files without uploading anything | When sync folder already has the correct files and you just need to link them |
Disabling Sync
Select "Disable sync" in the menu. MacSync will:
- Copy files back from sync folder to their original locations
- Remove symlinks
- Files in sync folder remain unchanged
CLI Reference
macsync # Interactive mode
macsync --dry-run # Preview without changes
macsync --sync-folder ~/path # Override sync folder
macsync --files ".zshrc,.gitconfig" # Override file list
macsync --verbose # Detailed output
macsync --quiet # Minimal output
macsync --help # Show help
How It Works
~/.zshrc (symlink) โ ~/Dropbox/MacSync/dotfiles/.zshrc (real file)
- Backup โ original files saved to
Backupdefaultconfig/<device><date>_<timestamp>/ - Move โ files relocated to
<SYNC_FOLDER>/dotfiles/ - Link โ symlinks created at original paths
dotfiles/ folder updated across devices.
Folder structure:
๐ SYNC_FOLDER
โโโ ๐ Backupdefault_config
โ โโโ ๐ iMac01-12-20251733011200
โ โ โโโ _config.cfg
โ โ โโโ .gitconfig
โ โ โโโ .otherconfig
โ โ โโโ .zshrc
โ โ
โ โโโ ๐ MacBook04-01-20261735948800
โ โโโ ๐ .oh-my-zsh
โ โ โโโ ๐ custom
โ โโโ ๐ Sites
โ โ โโโ ๐ My-site
โ โโโ _config.cfg
โ โโโ .gitconfig
โ โโโ .npmrc
โ โโโ .zshrc
โ
โโโ ๐ dotfiles
โโโ ๐ .oh-my-zsh
โ โโโ ๐ custom
โโโ ๐ Sites
โ โโโ ๐ My-site
โโโ .gitconfig
โโโ .otherconfig
โโโ .npmrc
โโโ .zshrc
Backupdefault_config/โ backups of original files (created before each sync)dotfiles/โ synced files, symlinked on all connected Macs
Security Considerations
- Sensitive files: Avoid syncing private keys (
.ssh/idrsa,.ssh/ided25519) or files with passwords. Use.ssh/configwith caution. - Cloud encryption: Ensure your cloud service encrypts data at rest and in transit.
- Permissions: MacSync preserves file permissions, but verify them after syncing sensitive files.
- Backup location: Backups are stored in your sync folder and will be synced across devices.
Troubleshooting
Sync folder not found โ verify path in ~/.macsync/config.cfg and ensure folder exists.
Broken symlinks โ run macsync --dry-run to diagnose; check that files exist in <SYNC_FOLDER>/dotfiles/.
Changes not syncing โ verify your sync service is running; check symlinks with ls -la ~/.zshrc.
Restore from backup โ find backups in Backupdefault_config/, or use "Disable sync" to restore automatically.
FAQ
Q: Can I sync files outside ~? A: No, MacSync only works with paths relative to home directory.
Q: What if I delete a file from the sync folder? A: Symlink breaks. Use "Disable sync" or restore from backup.
Q: Can I exclude files? A: Yes โ simply don't add them to BACKUP_FILES.
Requirements
- macOS 10.15+ (Catalina or newer)
- zsh (default since Catalina)
- rsync
Changelog
See CHANGELOG.md for a list of changes.
Website ยท GitHub ยท Issues ยท Contributing ยท MIT License