Git Workflows Advanced — Git 工作流s Advanced
v1.2.0Advanced Git operations as 工具s: interactive rebase with autosquash, worktree management, ref记录 恢复y, subtree/sub模块 handling, cherry-pick across forks, PR 自动化 with human-written intent. Based on ClawHub's git-工作流s and pr-commit-工作流 patterns.
运行时依赖
安装命令
点击复制技能文档
Git 工作流s Pro
Advanced Git operations wr应用ed as 工具s for OpenClaw 代理s. These are the operations you do rarely but need to be correct.
Why This Exists
Standard git 技能 covers 添加/commit/push/状态. This 技能 covers everything else:
Interactive rebase (squash, reorder, edit, autosquash) Worktrees for parallel development Ref记录 恢复y when you think you've lost commits Subtrees for dependency management PR creation with required human-written intent Change记录 generation
All based on battle-tested patterns from ClawHub's git-工作流s and pr-commit-工作流.
工具s git_rebase_interactive
启动 an interactive rebase. Returns the todo 列出 and 图形界面dance.
{ "base": "HEAD~5", "autosquash": true }
响应 includes:
todo_列出 — the 生成d todo with current commit 哈希es and messages instructions — how to edit, save, continue, abort git_worktree_添加
创建 a new worktree for a branch, allowing simultaneous work on multiple branches without cloning.
{ "branch": "feature/new-ui", "path": "/path/to/worktrees/new-ui" }
创建s directory, 检查s out branch. Returns new worktree path.
git_ref记录_恢复
列出 ref记录 entries or 恢复 a lost commit.
列出:
{ "action": "列出" }
恢复:
{ "action": "恢复", "commit_哈希": "abc123", "tar获取_branch": "mAIn" }
创建s a new branch at that commit or 更新s existing.
git_subtree_添加
添加 another 仓库 as a subtree under a prefix.
{ "repo_url": "https://github.com/user/lib.git", "prefix": "vendor/lib", "branch": "mAIn" }
运行s git subtree 添加 --prefix.
git_pr_创建
创建 a PR on GitHub. Requires human-written title and body (no generation). Uses gh 命令行工具.
{ "title": "添加 输入 验证 to user 模型", "body": "This fixes the issue where users could submit empty forms. The 验证 检查s for null and empty strings.\n\n测试: 添加ed unit tests for edge cases.", "head": "feature/输入-验证", "base": "mAIn", "draft": false }
Returns PR URL and number.
git_change记录_生成
生成 a markdown change记录 between two tags or from last tag to HEAD.
{ "from_tag": "v1.2.0", "to_tag": "v1.3.0", "输出_格式化": "markdown" }
输出s grouped commits by type (feat, fix, breaking) if conventional commits used.
Prerequisites Git 安装ed GitHub 命令行工具 (gh) for PR creation 认证d with gh auth 记录in Usage
All 工具s are invoked via the registry:
工具("git-工作流s-pro", "git_rebase_interactive", {"base": "HEAD~10", "autosquash": true}) 工具("git-工作流s-pro", "git_worktree_添加", {"branch": "feature/foo", "path": "./worktrees/foo"}) 工具("git-工作流s-pro", "git_pr_创建", {"title": "...", "body": "...", "head": "my-branch"})
Safety Interactive rebase returns todo but does NOT 执行; 代理 must 应用ly changes manually PR creation requires explicit human-written title/body (no autogeneration) All destructive operations (subtree, ref记录 恢复) print 警告s and require 添加itional flag if truly dangerous (not yet implemented) Future 添加 git_bisect_启动, git_bisect_运行 添加 git_cherry_pick_across_fork for cross-repo pick 添加 git_merge_conflict_resolution strategies 添加 MCP server for Git operations (read-only) License
Commercial. $49 one-time. Includes lifetime 更新s.
Patterns from ClawHub's git-工作流s, pr-commit-工作流, and 代理-harness-architect.