← Back to Skills Marketplace
vemec

Smart Git Backup

by vemec · GitHub ↗ · v1.0.0
cross-platform ✓ Security Clean
799
Downloads
2
Stars
3
Active Installs
1
Versions
Install in OpenClaw
/install memory-git-sync
Description
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.
README (SKILL.md)

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

Step Action Success Output Failure Output Exit
1 Validate Git repo [SUCCESS] Git repository found [ERROR] Not inside a git repository 1
2 Check Git config [SUCCESS] Git user configuration is valid [ERROR] Git user.name not configured 1
3 Check remote [SUCCESS] Remote 'origin' configured: [URL] [ERROR] No 'origin' remote 1
4 Setup .gitignore [SUCCESS] Gitignore file is ready - -
5 Scan large files [SUCCESS] No large files detected [WARNING] Large files detected -
6 Detect changes [SUCCESS] All changes staged [INFO] No uncommitted changes 0
7 Fetch remote [SUCCESS] Successfully fetched [WARNING] Fetch failed (continues) -
8 Check sync [INFO] Local and remote synchronized [WARNING] Branches diverged (auto-pull) 1*
9 Commit [SUCCESS] Changes committed [ERROR] Commit failed 1
10 Push [SUCCESS] Successfully pushed [WARNING] No upstream (tries to set) 1**
Done Complete [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

Issue Output Resolution
Not in a Git repo [ERROR] Not inside a git repository Navigate to repo: cd /path/to/repo
Missing user.name [ERROR] Git user.name not configured git config user.name "Name"
Missing user.email [ERROR] Git user.email not configured git config user.email "[email protected]"
No origin remote [ERROR] No 'origin' remote configured git remote add origin \x3CURL>
Large files detected [WARNING] Large files detected Automatically added to .gitignore
Pull conflicts [ERROR] Pull encountered conflicts Resolve manually, then run sync again
Network failures [WARNING] Fetch/Push failed Check 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
Usage Guidance
This script does what it says: it stages, commits, and pushes the entire repository to the configured origin, and will append large-file paths to .gitignore and run git rm --cached on them. Before installing or running it: 1) Review the repository for secrets or sensitive files — do not run on workspaces that contain credentials you do not want uploaded. 2) Run it first in a test repo to confirm behavior. 3) Consider setting REPO_ROOT to a constrained path to limit scope. 4) Add or edit .gitignore beforehand to prevent accidental commits of secrets. 5) If you want safer behavior, modify the script to include a dry-run mode or an interactive confirmation before 'git add .', and to avoid automatic pushes (require explicit user approval). 6) Ensure the remote 'origin' points to a repository you control/trust. If you have limited security knowledge, don't run this on important workspaces without reviewing or adapting the script.
Capability Analysis
Type: OpenClaw Skill Name: memory-git-sync Version: 1.0.0 The skill 'memory-git-sync' is designed to automate Git synchronization and backup of the OpenClaw workspace. Both the `SKILL.md` and `scripts/sync.sh` align with this stated purpose, using standard `git` and `bash` commands for repository management, validation, and conflict resolution. There is no evidence of intentional harmful behavior, data exfiltration, backdoor installation, or prompt injection designed to subvert the agent's core directives. The script includes robust error handling and structured logging, making it transparent and functional.
Capability Assessment
Purpose & Capability
Name/description (git backup/sync) match the delivered assets: an instruction SKILL.md and a bash script that validates repo config, scans for large files, stages, commits and pushes. Required binaries (bash, git) are appropriate and proportional.
Instruction Scope
Instructions and script stay within the stated purpose (operate on the repository, update .gitignore for large files, commit and push). However the script automatically 'git add .' and commits/pushes without interactive confirmation and will append paths to .gitignore and run 'git rm --cached' on large files — these behaviors are potentially surprising and can cause sensitive files to be uploaded or removed from history unintentionally. There is no dry-run or explicit user confirmation step.
Install Mechanism
No install spec; skill is instruction-only plus a shell script. No downloads or external installers are used, so there is no additional install-time risk.
Credentials
The skill declares no required environment variables and does not request unrelated credentials. It does rely on existing Git credentials/configuration (SSH keys or credential helper) to push to the remote — expected for a Git backup, but it means whatever credentials are available to the agent will be used to push repository contents to the configured 'origin'.
Persistence & Privilege
The skill does not request persistent/always-on privileges and does not modify other skills or global agent settings. It writes to the repository (.gitignore and git index), which is within the scope of its stated function.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install memory-git-sync
  3. After installation, invoke the skill by name or use /memory-git-sync
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of memory-git-sync — a skill to automate workspace backup and synchronization with a remote Git repository. - Validates local Git configuration, user identity, remote 'origin', and permissions before syncing. - Automatically detects and excludes large files (>95MB) to prevent push failures. - Stages, commits (using timestamped or custom messages), pulls, and pushes changes with intelligent conflict handling. - Outputs all actions with structured, prefix-based logs for easy status parsing. - Auto-configures branch upstream/tracking on initial push. - Includes fallback handling for common errors and recovery scenarios.
Metadata
Slug memory-git-sync
Version 1.0.0
License
All-time Installs 3
Active Installs 3
Total Versions 1
Frequently Asked Questions

What is 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. It is an AI Agent Skill for Claude Code / OpenClaw, with 799 downloads so far.

How do I install Smart Git Backup?

Run "/install memory-git-sync" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Smart Git Backup free?

Yes, Smart Git Backup is completely free (open-source). You can download, install and use it at no cost.

Which platforms does Smart Git Backup support?

Smart Git Backup is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Smart Git Backup?

It is built and maintained by vemec (@vemec); the current version is v1.0.0.

💬 Comments