Add sync script to repo
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/zsh
|
||||||
|
# Claude Code config sync script
|
||||||
|
# Pulls remote changes, commits local changes, and pushes
|
||||||
|
|
||||||
|
CLAUDE_DIR="$HOME/.claude"
|
||||||
|
cd "$CLAUDE_DIR" || exit 1
|
||||||
|
|
||||||
|
# Pull remote changes first (rebase to keep history clean)
|
||||||
|
git pull --rebase --quiet 2>/dev/null
|
||||||
|
|
||||||
|
# Stage syncable files
|
||||||
|
git add -A .
|
||||||
|
|
||||||
|
# Check if there are changes to commit
|
||||||
|
if ! git diff --cached --quiet; then
|
||||||
|
git commit -m "Auto-sync $(hostname -s) $(date +%Y-%m-%d\ %H:%M)" --quiet
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Push if we have commits ahead of remote
|
||||||
|
if git status | grep -q "ahead"; then
|
||||||
|
git push --quiet
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user