← 返回
开发者工具 中文

Smart Git Backup

Automates the backup of the OpenClaw workspace to a remote Git repository. Handles large file exclusions, validates git configuration, and performs intelligent sync with conflict resolution.
自动化将 OpenClaw 工作区备份至远程 Git 仓库,处理大文件排除、验证 Git 配置,并进行智能同步与冲突解决。
vemec vemec 来源
开发者工具 clawhub v1.0.0 1 版本 99913.2 Key: 无需
★ 2
Stars
📥 1,111
下载
💾 17
安装
1
版本
#latest

概述

Memory Sync Skill

Automates Git synchronization and backup of workspace memory to a remote repository.

Quick Start

bash ./scripts/sync.sh [COMMIT_MESSAGE]

Default message: chore: memory backup YYYY-MM-DD HH:MM

What It Does

  1. Validates Git repository, user config, and remote access
  2. Detects & excludes large files (>95MB) to prevent push failures
  3. Stages all changes automatically
  4. Pulls latest remote changes to avoid conflicts
  5. Commits changes with timestamped or custom message
  6. Pushes to remote, setting upstream if needed

Prerequisites

✓ Git repository initialized with origin remote

git config user.name and git config user.email set

✓ Network access to remote repository

✓ Write permissions on repository directory

Execution Steps

StepActionSuccess OutputFailure OutputExit
-----------------------
1Validate Git repo[SUCCESS] Git repository found[ERROR] Not inside a git repository1
2Check Git config[SUCCESS] Git user configuration is valid[ERROR] Git user.name not configured1
3Check remote[SUCCESS] Remote 'origin' configured: [URL][ERROR] No 'origin' remote1
4Setup .gitignore[SUCCESS] Gitignore file is ready--
5Scan large files[SUCCESS] No large files detected[WARNING] Large files detected-
6Detect changes[SUCCESS] All changes staged[INFO] No uncommitted changes0
7Fetch remote[SUCCESS] Successfully fetched[WARNING] Fetch failed (continues)-
8Check sync[INFO] Local and remote synchronized[WARNING] Branches diverged (auto-pull)1*
9Commit[SUCCESS] Changes committed[ERROR] Commit failed1
10Push[SUCCESS] Successfully pushed[WARNING] No upstream (tries to set)1**
DoneComplete[SUCCESS] Sync completed-0

*Auto-resolves with git pull --no-edit

**Auto-sets upstream with git push --set-upstream origin [branch]

Output Format

All messages use structured prefixes for LLM parsing:

[INFO]    - Informational messages
[SUCCESS] - Actions completed successfully
[WARNING] - Non-fatal issues (script recovers)
[ERROR]   - Fatal errors (requires intervention)

Common Scenarios

IssueOutputResolution
--------------------------
Not in a Git repo[ERROR] Not inside a git repositoryNavigate to repo: cd /path/to/repo
Missing user.name[ERROR] Git user.name not configuredgit config user.name "Name"
Missing user.email[ERROR] Git user.email not configuredgit config user.email "email@example.com"
No origin remote[ERROR] No 'origin' remote configuredgit remote add origin
Large files detected[WARNING] Large files detectedAutomatically added to .gitignore
Pull conflicts[ERROR] Pull encountered conflictsResolve manually, then run sync again
Network failures[WARNING] Fetch/Push failedCheck connectivity, script continues locally

Features

  • Auto Large-File Handling: Prevents Git failures by ignoring files >95MB
  • Conflict Resolution: Auto-pulls remote before pushing
  • Upstream Setup: Auto-configures tracking on first push
  • Validation: Pre-flight checks prevent common errors
  • LLM-Compatible Output: Structured logs for easy parsing

Security Notes

  • Don't commit credentials to the repository
  • Use SSH keys or credential helpers: git config credential.helper osxkeychain
  • Review changes before syncing: git status
  • Large files already pushed can't be auto-removed by this script

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-29 03:12 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 72 📥 181,521
dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 677 📥 326,132
design-media

Generate Protoss-style (StarCraft) voice effects using SoX and FFmpeg.

vemec
为任意音频文件添加《星际争霸》神族风格灵能特效,可用作TTS或用户录音的后处理层。
★ 3 📥 2,162