Repository navigation
Git 备份纳入 .claude,已装技能不进 Git、换机后自动重装 - #124
Merged
Merged
Conversation
- .claude 不再排除,可备份;工作区内的相对链接可以原样进 Git - 已安装的技能(.agents/skills、.claude/skills、skills-lock.json)与含令牌的 .mcp.json 不进 Git;用仓库内容初始化或还原时以本地为准保留 - 备份忽略节点用户的全局忽略文件,勾选的文件强制加入,不再因 .gitignore 整体失败 - 换机后按原配置自动排队重装技能,内部技能沿用当前生效的批准;排不上的仍提示手动重装 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
模拟「新服务器 + 从 Git 恢复机器人」后发现:首次备份可能因节点的全局忽略文件整体失败;
.mcp.json可被明文提交;迁移后技能全部标为失败需逐个手动重装;.claude被排除导致技能链接无法备份。改动
.claude进 Git:从排除名单移除;工作区内、不指向敏感文件的相对链接可以原样备份。.agents/skills、.claude/skills、skills-lock.json与.mcp.json(含 MCP 令牌与请求头)不在备份列表、拒绝备份,并在「不进 Git」列表里显示。用仓库内容初始化或一键还原时,这些以本地为准保留。core.excludesFile=/dev/null,不受节点用户~/.config/git/ignore影响;勾选的文件用add -f,工作目录自己的.gitignore也不会让首次备份失败。switch_relay绑定新实例后,按原环境分组、数据源和用户变量排队重装(migrate模式,由执行换机的机器人管理员或 manager 发起)。内部技能沿用当前生效的那次批准(审批人与时间须与安装记录一致),不新建审批;排不上队的保持失败并提示手动重装。last_data_source移到installation.py供两处复用。测试
tests/unit/test_runtime_workspace.py:全局忽略与.gitignore下的首次备份、技能与.mcp.json不列出且拒绝备份、还原时本地技能优先。tests/api/test_bot_skills.py:换机后内部技能按原批准重装,不产生新审批。tests/api/test_workspace_migration.py:复制迁移绑定新实例后触发重装。兼容性
运行时改动需升级节点。无数据库迁移。
🤖 Generated with Claude Code