Git Automation

Type: Workspace version control practices for OpenClaw

Definition

Git automation covers the version control practices for maintaining an OpenClaw workspace: initializing the workspace with git init, defining what to version (source code, templates, SOUL.md, AGENTS.md, MEMORY.md, openclaw.json) versus what to ignore (secrets, logs, reports, drafts), writing meaningful commit messages, and establishing conventions that make the workspace maintainable over time. All repos must be private; never overwrite existing local repos without checking remote first.

How It Works

Initialize with git init in the workspace root. The key discipline is separating versioned content from transient content:

Version control: scripts in /scripts/, templates in /templates/, SOUL.md, AGENTS.md, MEMORY.md, USER.md, TOOLS.md, openclaw.json (non-secret config only), project source code, AGENTS.md quick start section covering status commands, main entry point, key commands, and running cron jobs.

Never version control: /secrets/ (credentials, API keys), /logs/ (runtime logs), /reports/ (generated output), /drafts/ (work in progress), and any file containing credentials or PII.

Set up .gitignore to exclude sensitive directories. Commit with messages that describe what changed and why — not just "update." Document decisions in commit messages, not just processes. The "why" ages better than the "what."

The AGENTS.md should have a quick start section at the top covering: how to check running status, what the main entry point is, key commands to know, currently running cron jobs. This helps anyone (including future you) understand the workspace state at a glance.

A CHANGELOG tracking what changed and when is essential for surviving the gap between building and debugging months later.

Key Properties

  • git init workspace — initialize the workspace as a git repo from day one
  • Version what matters — scripts, templates, identity files (SOUL/AGENTS/MEMORY/USER/TOOLS), openclaw.json config
  • Never version secrets/logs/reports/drafts — .gitignore excludes credentials, runtime data, generated output
  • Meaningful commit messages — describe what changed and why; not just "update"
  • Document decisions — commit messages record the "why," not just the "what"
  • CHANGELOG — track changes over time for debugging months later
  • workspace-boot — workspace files (SOUL.md, AGENTS.md, MEMORY.md) are versioned and read at session start
  • quality-gates — AGENTS.md quick start section is part of the operating manual quality

Source Chapters