Cross-Machine Sync
Sync your skills across multiple computers using git.
Overview
┌──────────────────────────────────────────────────────────────┐
│ CROSS-MACHINE SYNC │
│ │
│ ┌─────────────────┐ ┌─────────────────┐ │
│ │ Machine A │ │ Machine B │ │
│ │ (Work) │ │ (Home) │ │
│ │ │ │ │ │
│ │ ┌───────────┐ │ │ ┌───────────┐ │ │
│ │ │ Claude │ │ │ │ Claude │ │ │
│ │ │ Cursor │ │ │ │ Codex │ │ │
│ │ └─────┬─────┘ │ │ └─────┬─────┘ │ │
│ │ │ │ │ │ │ │
│ │ ▼ │ │ ▼ │ │
│ │ ┌───────────┐ │ push pull │ ┌───────────┐ │ │
│ │ │ Source │──┼────────►───────────┼──│ Source │ │ │
│ │ │ (git) │ │ ┌──────────┐ │ │ (git) │ │ │
│ │ └───────────┘ │ │ GitHub │ │ └───────────┘ │ │
│ │ │ │ Remote │ │ │ │
│ └─────────────────┘ └──────────┘ └─────────────────┘ │
│ │
└──────────────────────────────────────────────────────────────┘
Initial Setup
Option 1: New setup with remote
skillshare init --remote [email protected]:you/my-skills.git
This:
- Creates source directory
- Initializes git
- Adds remote
- Auto-detects and configures targets
Option 2: Add remote to existing setup
cd ~/.config/skillshare/skills
git init
git remote add origin [email protected]:you/my-skills.git
git add .
git commit -m "Initial commit"
git push -u origin main
Second Machine Setup
On a new machine:
# 1. Clone your skills repo
git clone [email protected]:you/my-skills.git ~/.config/skillshare/skills
# 2. Initialize skillshare (uses existing source)
skillshare init --source ~/.config/skillshare/skills
# 3. Sync to all local targets
skillshare sync
Daily Workflow
Machine A: Make changes and push
# Edit skills (changes visible immediately via symlinks)
$EDITOR ~/.config/skillshare/skills/my-skill/SKILL.md
# Push to remote
skillshare push -m "Update my-skill"
Machine B: Pull and sync
skillshare pull
That's it. pull automatically runs sync after pulling.
Commands
Push
Commit and push local changes:
skillshare push # Auto-generated message
skillshare push -m "Add pdf" # Custom message
What happens:
git add .
git commit -m "Add pdf"
git push origin main
Pull
Pull remote changes and sync:
skillshare pull
What happens:
git pull origin main
skillshare sync
Conflict Handling
Push fails (remote ahead)
$ skillshare push
Error: remote has changes. Run 'skillshare pull' first.
Solution:
skillshare pull
skillshare push
Pull fails (local uncommitted changes)
$ skillshare pull
Error: local has uncommitted changes.
Solution:
# Option 1: Push your changes first
skillshare push -m "Local changes"
skillshare pull
# Option 2: Discard local changes
cd ~/.config/skillshare/skills
git checkout -- .
skillshare pull
Merge conflicts
cd ~/.config/skillshare/skills
git status # See conflicted files
# Edit files to resolve
git add .
git commit -m "Resolve conflicts"
skillshare sync
Check Status
skillshare status
Shows:
- Git status (clean, ahead, behind)
- Remote configuration
- Sync status
Private Repository
Use SSH URL for private repos:
skillshare init --remote [email protected]:you/private-skills.git
Tips
Use SSH keys
Set up SSH keys to avoid password prompts:
ssh-keygen -t ed25519 -C "[email protected]"
# Add public key to GitHub
Multiple remotes
Add backup remotes:
cd ~/.config/skillshare/skills
git remote add backup [email protected]:you/skills-backup.git
git push backup main
Sync on shell startup
Add to ~/.bashrc or ~/.zshrc:
# Sync skillshare on terminal open (if remote configured)
skillshare pull 2>/dev/null
Related
- Team Sharing — Share with your team
- Commands: push — Push command details
- Commands: pull — Pull command details