<< All versions
Skill v1.0.0
currentLLM-judged scan90/100oozoofrog/claude-github-sync/pull
──Details
PublishedOctober 24, 2026 at 02:40 PM
Content Hashsha256:24aab938b5874cbd...
Git SHA669453072978
──Files
Files (1 file, 4.3 KB)
SKILL.md4.3 KBactive
SKILL.md · 164 lines · 4.3 KB
version: "1.0.0" name: pull description: Pull latest configuration from GitHub
Pull Configuration
Pull the latest configuration from your GitHub repository and automatically merge settings.
Usage
/claude-github-sync:pull
Configuration Reference
| Item | Path | Description | |
|---|---|---|---|
| Config file | ~/.claude/sync-config.json | Sync configuration (repo URL, setup method) | |
| Git remote | ~/.claude/.git/config | Primary check - git origin remote URL | |
| Sync settings | ~/.claude/settings.sync.json | Shared settings (synced to GitHub) | |
| Local settings | ~/.claude/settings.local.json | Machine-specific settings (gitignored) | |
| Merged output | ~/.claude/settings.json | Auto-merged result of sync + local | |
| Merge script | ~/.claude/scripts/merge-settings.mjs | Deep merges sync + local → settings.json |
Instructions
Step 1: Check git remote (primary check)
The sync is configured if ~/.claude has a git remote. Config file (~/.claude/sync-config.json) is optional fallback.
bash
cd ~/.claude# Primary check: git remoteREPO_URL=$(git remote get-url origin 2>/dev/null)if [ -n "$REPO_URL" ]; thenecho "✅ Remote: $REPO_URL"else# Fallback: check config fileCONFIG_FILE="$HOME/.claude/sync-config.json"if [ -f "$CONFIG_FILE" ]; thenecho "⚠️ Config exists but no git remote"echo "Run: /claude-github-sync:setup to fix"exit 1elseecho "❌ Not configured"echo ""echo "Run: /claude-github-sync:setup"exit 1fifi
Step 2: Pull changes
bash
cd ~/.claude# Get current branchBRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "main")# Save current HEAD for change detectionHEAD_BEFORE=$(git rev-parse HEAD 2>/dev/null)# Stash local changes if anySTASHED=falseif ! git diff --quiet 2>/dev/null; thenecho "Stashing local changes..."git stashSTASHED=truefi# Pull with rebaseif git pull --rebase origin "$BRANCH" 2>&1; thenecho "✅ Pulled latest configuration"elseecho "❌ Pull failed"echo ""echo "Possible issues:"echo " - Network connection"echo " - Merge conflicts (run: git status)"echo " - Remote branch doesn't exist"git status --shortfi# Restore stashed changesif [ "$STASHED" = true ]; thenecho "Restoring local changes..."git stash popfi# Show what changedHEAD_AFTER=$(git rev-parse HEAD 2>/dev/null)if [ "$HEAD_BEFORE" != "$HEAD_AFTER" ]; thenecho ""echo "📋 Changes pulled:"echo ""echo "--- New commits ---"git log --oneline "$HEAD_BEFORE..$HEAD_AFTER"echo ""echo "--- Files changed ---"git diff --stat "$HEAD_BEFORE..$HEAD_AFTER"elseecho ""echo "📋 No new changes from remote."fi
Step 3: Merge settings
After pulling, automatically merge sync and local settings.
The merge script can be in multiple locations:
~/.claude/scripts/merge-settings.mjs(user installed)- Plugin's scripts directory (bundled)
bash
cd ~/.claude# Find merge script in multiple locationsMERGE_SCRIPT=""# Location 1: User's scripts directoryif [ -f "$HOME/.claude/scripts/merge-settings.mjs" ]; thenMERGE_SCRIPT="$HOME/.claude/scripts/merge-settings.mjs"fi# Location 2: Plugin cache (find latest version)if [ -z "$MERGE_SCRIPT" ]; thenPLUGIN_SCRIPT=$(find "$HOME/.claude/plugins/cache/claude-sync/claude-github-sync" -name "merge-settings.mjs" 2>/dev/null | head -1)if [ -n "$PLUGIN_SCRIPT" ]; thenMERGE_SCRIPT="$PLUGIN_SCRIPT"fifi# Location 3: Marketplace sourceif [ -z "$MERGE_SCRIPT" ]; thenMARKETPLACE_SCRIPT="$HOME/.claude/plugins/marketplaces/claude-sync/scripts/merge-settings.mjs"if [ -f "$MARKETPLACE_SCRIPT" ]; thenMERGE_SCRIPT="$MARKETPLACE_SCRIPT"fifi# Run merge if foundif [ -n "$MERGE_SCRIPT" ]; thenecho ""echo "Merging settings..."node "$MERGE_SCRIPT"elseecho ""echo "⚠️ merge-settings.mjs not found"echo " Settings will not be auto-merged"fi
Step 4: Report result
Show the user what was updated.
bash
echo ""echo "📊 Current settings files:"ls -la ~/.claude/settings*.json 2>/dev/null | awk '{print " " $9 " (" $5 " bytes)"}'