obsidian-github-sync
БесплатноЗапускает вложенные скриптыНе проверенAutomated GitHub synchronization for Obsidian vault with conflict detection and notification. Use when the user wants to: - Sync their Obsidian vault to a…
от jiaxiaojunQAQ★ 35 звёзд на GitHubОб этом скилле
Obsidian GitHub Sync
Automated synchronization of Obsidian vault with GitHub repository using git with conflict detection.
Features
- Automatic sync:
git pull --rebase→ commit → push - Conflict detection: Detects and flags merge conflicts
- Configurable: Environment variable based configuration
- Notification: Optional conflict notifications
- Safe: Uses rebase to maintain clean history
Quick Start
1. Set Environment Variables
export OBSIDIAN_VAULT_DIR="/path/to/your/obsidian-vault"
export GITHUB_REMOTE_URL="[email protected]:username/repo.git"
2. Run Initial Sync
./scripts/obsidian-sync.sh
3. Setup Auto-sync (Cron)
# Daily at 3 AM
0 3 * * * /path/to/scripts/obsidian-sync.sh
# Check conflicts at 9 AM
0 9 * * * /path/to/scripts/check-conflict.sh
Scripts
obsidian-sync.sh
Main synchronization script. Located at scripts/obsidian-sync.sh.
What it does:
- Checks for uncommitted changes and commits them
- Pulls from GitHub with
--rebase - Pushes to GitHub
- Creates conflict flag if rebase fails
Environment Variables:
OBSIDIAN_VAULT_DIR(required): Path to Obsidian vaultGITHUB_REMOTE_URL(required): GitHub repository URLGIT_USER_NAME(optional): Git user nameGIT_USER_EMAIL(optional): Git user emailSYNC_LOG_FILE(optional): Log file path (default:/tmp/obsidian-sync.log)CONFLICT_FLAG_FILE(optional): Conflict flag path (default:/tmp/obsidian-sync-conflict.flag)
check-conflict.sh
Conflict checking script. Located at scripts/check-conflict.sh.
What it does:
- Checks if conflict flag file exists
- Outputs conflict details if found
- Returns exit code 1 on conflict, 0 on clean state
Workflow
Normal Sync Flow
User modifies notes in Obsidian
↓
Cron runs obsidian-sync.sh at 3 AM
↓
Auto-commit local changes
↓
git pull --rebase origin master
↓
git push origin master
↓
Sync complete ✓
Conflict Flow
Sync runs
↓
pull --rebase fails (remote has divergent changes)
↓
Create conflict flag file
↓
Exit with error
↓
Morning check-conflict.sh detects flag
↓
Notify user
↓
User resolves conflicts manually
↓
Re-run sync
Handling Conflicts
When conflicts occur:
- Check conflict flag file location (default:
/tmp/obsidian-sync-conflict.flag) - Navigate to vault directory
- Resolve conflicts using standard git workflow:
cd $OBSIDIAN_VAULT_DIR
git status # See conflicted files
# Edit files to resolve conflicts
git add -A # Stage resolved files
git rebase --continue # Complete rebase
git push origin master # Push resolved state
Configuration Reference
See references/setup-guide.md for detailed setup instructions including:
- SSH key configuration
- Multi-device sync best practices
- Troubleshooting guide
- Cron setup examples
Integration Examples
With OpenClaw
# Add sync cron job
openclaw cron add --name "obsidian-sync" \
--cron "0 3 * * *" \
--command "/path/to/obsidian-sync.sh"
# Add conflict check
openclaw cron add --name "obsidian-check" \
--cron "0 9 * * *" \
--command "/path/to/check-conflict.sh"
With Systemd (Linux)
Create ~/.config/systemd/user/obsidian-sync.service:
[Unit]
Description=Obsidian Vault Git Sync
[Service]
Type=oneshot
Environment="OBSIDIAN_VAULT_DIR=/path/to/vault"
Environment="[email protected]:user/repo.git"
ExecStart=/path/to/obsidian-sync.sh
Create ~/.config/systemd/user/obsidian-sync.timer:
[Unit]
Description=Run Obsidian sync daily at 3 AM
[Timer]
OnCalendar=*-*-* 03:00:00
Persistent=true
[Install]
WantedBy=timers.target
Enable:
systemctl --user daemon-reload
systemctl --user enable obsidian-sync.timer
systemctl --user start obsidian-sync.timer
Best Practices
- Close Obsidian during sync to avoid file lock issues
- Commit regularly in Obsidian to reduce conflict chances
- Sync before switching devices
- Use
.gitignoreto exclude Obsidian's cache files:
# Obsidian
.obsidian/workspace.json
.obsidian/workspace-mobile.json
.obsidian/plugins/*/data.json
.trash/
License
MIT
Установить obsidian-github-sync в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл obsidian-github-sync?
Automated GitHub synchronization for Obsidian vault with conflict detection and notification. Use when the user wants to: - Sync their Obsidian vault to a GitHub repository - Set up automatic daily synchronization - Handle git conflicts in Obsidian vault - Configure git-based backup for Obsidian notes Triggers on phrases like: "sync obsidian", "obsidian github", "vault backup", "sync my notes", "setup obsidian git sync"
Как установить скилл obsidian-github-sync?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл obsidian-github-sync запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic