远程同步
通过独立的私有 sidecar Git 仓库在多机之间移动项目会话。对话始终绑在正确的分支和 commit 上——绝不进源码历史。
为什么需要它
远程同步是起点——但同一套工具箱现在还能本地迁移 provider、跨工具转换会话、诊断整条链路。
会话靠 cwd、remote、branch、commit、workdir 匹配——不是正文文本。不同项目的会话不会互相污染。
会话存在独立的 .agent-sync-store/ sidecar 仓库里。业务提交只包含源码。
Workflow
示例项目是 shop-admin。左侧是时序图,每一步都会出现新的动作;右侧显示这一步写入、读取或改变的具体数据。
工具先读取当前业务仓库 remote,再创建本地配置和独立 sidecar Git 仓库。
git agent-sync init --remote git@github.com:wood-q/agent-session-store.git{ "projectName": "shop-admin", "projectIdentity": "git:github.com/wood-q/shop-admin", "projectId": "shop-admin-a18c4f2d09", "storePath": "/repo/shop-admin/.agent-sync-store", "remote": "git@github.com:wood-q/agent-session-store.git"}agent-sync initialized for shop-admin
store: /repo/shop-admin/.agent-sync-store
project id: shop-admin-a18c4f2d09
Install
npm install -g git-agent-sync
git agent-sync --helpgit agent-sync init --remote git@github.com:you/agent-session-store.git
git agent-sync push --m "sync current agent sessions"
git agent-sync restore --latest 1