跳到正文
cccskills
免费在 GitHub 公开中文介绍

sibling-checkout-commits

将同一台机器上另一份检出中的提交按顺序作为补丁应用,无需获取完整历史;检查路径冲突、核对补丁 ID,并避免把共享暂存区中的其他改动带入提交。

原文查看原文说明

Take commits from a sibling checkout as patches, without a fetch.

JetBrains/intellij-community星标 20,685(GitHub 20,685 + cccskills 0)

实测评分 未实测

查看安装方法

适用场景

  • 从另一份检出移入提交
  • 不获取历史,只转移改动
  • 检查补丁与本地改动的冲突
  • 避免混入其他已暂存文件

中文介绍

功能

本技能指导你把同一台机器上另一份检出中的提交作为补丁转移过来,无需获取仓库的完整历史。脚本会按顺序应用指定改动;如果补丁涉及当前有未提交改动的路径,就会停止。每个补丁应用后都会创建一个新提交,并确认补丁 ID 相符。流程还会说明如何避免把其他会话暂存的文件带入提交,以及如何处理新建或改名的文件。

适用场景

当你需要把另一份检出中的改动带到当前工作树,又不想克隆、使用 worktree 或获取完整历史时,可以使用本技能。如果获取历史耗时较长,或你希望逐项检查改动顺序和应用结果,它也很适用。

使用示例

  • “请把相邻检出中到 master 为止的提交作为补丁移入。”
  • “请检查要移入的补丁是否与本地改动冲突。”

注意事项

补丁无法应用时,流程会报告路径和提交并停止。应手动处理冲突,不要把解决冲突的改动放进署名为另一份检出作者的提交。周末提交时,按个人 CLAUDE.md 中的提交者日期规则处理。

本介绍由 AI(OpenAI Codex)根据公开的 SKILL.md 撰写。准确的规格请查看下方原文。

文档检查

AI 根据 SKILL.md 的内容检查了需要注意的操作和使用前提。评分只依据实际运行的结果(实测对比)。

安全性发送数据、删除文件、执行命令等是否有说明
B部分不足会应用并提交补丁,但未说明应用或提交前的确认步骤。
安装难易度所需工具和 API 密钥是否少且有说明
A良好前提是另一份检出和 Git,未提及其他安装要求。

不计入评分。 由 AI(OpenAI Codex)于 2026年10月28日 评估。仅供参考,安装前请同时查看原文。

如果您认为评估有误,请申请复核

请写明哪一项有误以及原因。无需登录。我们会对照 SKILL.md 重新评估,并在此处更新结果。

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

包含的文件(2)

  • SKILL.md3.1 KB
  • scripts/take-patches.sh3.2 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

<!-- Generated by community/.ai/render-guides.mjs; edit community/.agents/skills/sibling-checkout-commits/SKILL.md -->

Commits from a sibling checkout

Use this skill when another checkout of the monorepo on this machine holds commits that this checkout needs, for example a reorganization that a new change builds on. The user keeps the checkouts separate, so a clone, a worktree or a shared directory is not an option.

Why not fetch

A git fetch /path/to/sibling walks and packs objects over the whole history. With a hundred upstream commits of difference it took more than 15 minutes here, and a second fetch of 12 new commits did not finish in 10 minutes. It also leaves a remote-tracking ref and a copy of every object behind. A patch carries only the change.

Procedure

  1. Find the range in the sibling. The base is the last sibling commit this checkout already has; a commit taken before has a new hash here, so compare by subject or by patch id (git patch-id --stable), not by hash.

  2. From the root of the receiving checkout run the script. It writes the patches under out/sibling-patches/, refuses when a patch touches a path that is dirty here, then applies and commits each patch in order:

    ./community/.agents/skills/sibling-checkout-commits/scripts/take-patches.sh ../idea-2 <base>..master
    
  3. Read the ok lines. Each one names the new commit and confirms that its patch id equals the patch. A DIFF line stops the script; the commit on HEAD then holds something else, and the next patch is not applied.

  4. On a weekend, the committer date is today: apply the weekend rule of the personal CLAUDE.md to the new commits.

What the script does, and does not do

  • git apply --binary changes the working tree only. git commit --only -- <paths> builds the commit from HEAD plus those paths, so nothing that a concurrent session staged in the shared index lands in the commit.
  • A path that a patch creates or renames is untracked after the apply, and --only skips an untracked path. The script marks every such path with git add -N first; an intent-to-add entry carries no content.
  • A path that a patch deletes stays in the pathspec, so the commit records the deletion.
  • The author, the date and the message come from the patch through git mailinfo.
  • It does not use git am: git am commits the shared index, and a concurrent session's staged files would land in the commit.
  • It does not fetch, and it creates no ref. Delete a ref of an earlier fetch with git update-ref -d refs/remotes/<name>/master.

When a patch does not apply

A patch of the range depends on the patches before it, so a --check of a later patch alone fails. The script applies in order. When a patch fails against this tree, the sibling and this checkout diverged on that path: stop, name the path and the commit in the report, and let the user decide. Do not resolve the conflict by hand inside a commit that carries the sibling author's name.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

actions

免费有简介

实现或修改 IntelliJ `AnAction`,并在 `plugin.xml` 中注册。将显示名称和说明写入消息资源文件,按需设置图标,并通过事件协程作用域启动挂起任务,避免同步处理阻塞 IDE。

  • 为 IDE 菜单添加操作
  • 修改操作注册或图标
  • 整理操作名称和说明
JetBrains/intellij-community2.1万2026年10月29日 更新

bazel-test-migration

免费有简介

将 IntelliJ JPS 测试模块迁移到 Bazel,并排查仅在 Bazel 中出现的失败。根据症状检查依赖、插件、测试数据和 runfiles,重新生成并验证目标。

  • 将 JPS 测试模块迁移到 Bazel
  • 排查仅在 Bazel 中失败的测试
  • 检查测试依赖和数据配置
JetBrains/intellij-community2.1万2026年10月29日 更新

code-style

免费有简介

按 IntelliJ 项目规范编写或审查 Kotlin 和 Java 代码,涵盖语言选择、格式、密封类型、线程注解及控制流异常处理。

  • 按 IntelliJ 规范编写 Kotlin
  • 审查 Java 代码
  • 检查异常处理和密封类型分支
JetBrains/intellij-community2.1万2026年10月29日 更新

commits

免费有简介

本指南帮助您按 IntelliJ 项目规则拆分更改并撰写提交信息:有工单时使用编号和变更说明,无工单时使用标签与子系统名,并在需要时说明原因和决定。

  • 按项目格式编写带工单号的提交信息
  • 整理测试或文档提交并选择合适标签
  • 按规则修改已有提交信息
JetBrains/intellij-community2.1万2026年10月29日 更新

使用多个 Python 类型检查器比较代码片段或文件的类型推断和报错判断,并汇总各工具的结论、耗时与诊断信息,可保存为 Markdown 报告。

  • 比较不同检查器的类型推断
  • 确认代码是否会被判为类型错误
  • 查看多个工具的诊断差异
JetBrains/intellij-community2.1万2026年10月29日 更新

整理 Compose Desktop 界面中的状态和副作用,让可组合函数负责绘制,由展示器或协调器处理应用决策。了解状态归属、Effect、可复用组件接口、延迟列表键、动画和性能,适用于单项界面修改。

  • 分离界面绘制与展示器决策
  • 整理界面状态的归属
  • 检查 Effect 键和协程用法
JetBrains/intellij-community2.1万2026年10月29日 更新

查看 JetBrains 的全部技能

报告此技能的问题