Install
openclaw skills install git-managerPerform common Git operations like status, commit, push, pull, branch management, and merge with safety checks and dry-run support.
openclaw skills install git-managerThis skill safely executes common Git commands. It wraps git CLI with additional safety checks and structured output.
status - Show working tree statuscommit - Stage changes and commit (with message)push - Push to remotepull - Pull from remote (rebase or merge)branch - Create, list, delete branchescheckout - Switch branchesmerge - Merge branchesstash - Stash/apply changeslog - Show commit historydiff - Show changes--force must be explicit)main/master/production~/.openclaw/logs/git-manager.logUser says:
# Status
git-manager --action status --repo /path/to/repo
# Commit all changes
git-manager --action commit --repo /path/to/repo --message "feat: add user auth"
# Commit specific files
git-manager --action commit --repo /path/to/repo --files [file1,file2] --message "fix: bug in payment"
# Push
git-manager --action push --repo /path/to/repo --branch feature-xyz
# Pull
git-manager --action pull --repo /path/to/repo --branch main
# Create branch
git-manager --action branch --repo /path/to/repo --create new-branch --from main
# Checkout
git-manager --action checkout --repo /path/to/repo --branch feature-xyz
# Diff
git-manager --action diff --repo /path/to/repo --files [file1]
JSON with fields:
success: booleanoutput: string (raw git output)error: string (if failed)changed_files: array (for commit)commit_sha: string (after commit)branch: current branchExample:
{
"success": true,
"action": "commit",
"commit_sha": "abc123def",
"changed_files": ["src/auth.py", "tests/test_auth.py"],
"output": "[main abc123] feat: add user auth\n 2 files changed, 45 insertions(+)"
}
GIT_MANAGER_LOG: path to activity log (default ~/.openclaw/logs/git-manager.log)GIT_MANAGER_DRY_RUN: set "1" to default to dry-runGIT_MANAGER_PROTECTED_BRANCHES: comma-separated list (default main,master,production)When used from a developer role session:
cwd as the repo if --repo not providedstatus -> commit -> push in one gogit diff (if --message omitted)# Developer session
sessions_spawn(
task="提交刚才修改的登录页面样式",
config="configs/developer.yaml",
attachments=[]
)
# The skill will: git add . && git commit -m "style: improve login page" && git push
| Issue | Check |
|---|---|
| Permission denied (publickey) | SSH agent running? ssh-add -l |
| Not a git repository | --repo path correct? |
| Branch protected | Cannot commit to main; create feature branch first |
| Merge conflict | Resolve manually; skill only detects conflict |
gh pr create)