Token导航 LogoToken导航

Agent Skill · 研究检索

git:merge-worktree(git 合并工作树)

git:merge-worktree 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

git:merge-worktree 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,暂无第三方扫描结果,按安装量在研究检索类的 73,675 个 Skill 里排第 11,953。

总安装 10,716周安装 451GitHub Stars 891下载 3,752核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:git:merge-worktree(git 合并工作树)
来源仓库:https://github.com/neolabhq/context-engineering-kit
仓库路径:skills/git:merge-worktree
安装命令:
npx skills add https://github.com/neolabhq/context-engineering-kit --skill git:merge-worktree
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/neolabhq/context-engineering-kit --skill git:merge-worktree

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

git:merge-worktree 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词或上下文快速获取结果。适用于工作树管理、分支分析或协作流程支持等场景。通过安装命令集成,具体实现需参考原始 README 文档。

使用前应评估权限范围,避免触发意外的网络或文件系统操作。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/git:merge-worktree

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/neolabhq/context-engineering-kit --skill git:m…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

git:merge-worktree 怎么安装?

在终端执行 npx skills add https://github.com/neolabhq/context-engineering-kit --skill git:merge-workt…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

git:merge-worktree 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

git:merge-worktree 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

git:merge-worktree 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

git:merge-worktree 用的人多吗?

公开数据是累计安装 10,716 次,近一周安装 451 次,下载 3,752 次,GitHub 891 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

git:merge-worktree 安全吗?

没有查到第三方扫描结果,安全性无法从公开资料判断,安装前请自行审查源码、依赖和命令行为。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 没有第三方扫描结果,安全性只能靠自己读源码判断。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 要求有安全扫描结论才肯安装的团队。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
git:merge-worktree

git 合并工作树 · 本页

10,716891需要联网未明确未收录

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Claude Command: Merge Worktree

Your job is to help users merge changes from git worktrees into their current branch, supporting multiple merge strategies from simple file checkout to selective cherry-picking.

Instructions

CRITICAL: Perform the following steps exactly as described:

  1. Current state check: Run git worktree list to show all existing worktrees and git status to verify working directory state
  2. Parse user input: Determine what merge operation the user wants:

- --interactive or no arguments: Guided interactive mode - File/directory path: Merge specific file(s) or directory from a worktree - Commit name: Cherry-pick a specific commit - Branch name: Merge from that branch's worktree - --from <worktree>: Specify source worktree explicitly - --patch or -p: Use interactive patch selection mode

  1. Determine source worktree/branch: a. If user specified --from <worktree>: Use that worktree path directly b. If user specified a branch name: Find worktree for that branch from git worktree list c. If only one other worktree exists: Ask to confirm using it as source d. If multiple worktrees exist: Present list and ask user which to merge from e. If no other worktrees exist: Explain and offer to use branch-based merge instead
  2. Determine merge strategy: Present options based on user's needs: Strategy A: Selective File Checkout (for specific files/directories) Strategy B: Interactive Patch Selection (for partial file changes) Strategy C: Cherry-Pick with Selective Staging (for specific commits) Strategy D: Manual Merge with Conflicts (for complex merges) Strategy E: Multi-Worktree Selective Merge (combining from multiple sources)

- Best for: Getting complete file(s) from another branch - Command: git checkout <branch> -- <path> - Best for: Selecting specific hunks/lines from a file - Command: git checkout -p <branch> -- <path> - Prompts user for each hunk: y (apply), n (skip), s (split), e (edit) - Best for: Applying a commit but excluding some changes - Steps: 1. git cherry-pick --no-commit <commit> 2. Review staged changes 3. git reset HEAD -- <unwanted-files> to unstage 4. git checkout -- <unwanted-files> to discard 5. git commit -m "message" - Best for: Full branch merge with control over resolution - Steps: 1. git merge --no-commit <branch> 2. Review all changes 3. Selectively stage/unstage files 4. Resolve conflicts if any 5. git commit -m "message" - Best for: Taking different files from different worktrees - Steps: 1. git checkout <branch1> -- <path1> 2. git checkout <branch2> -- <path2> 3. git commit -m "Merge selected files from multiple branches"

  1. Execute the selected strategy:

- Run pre-merge comparison if user wants to review (suggest /git:compare-worktrees first) - Execute git commands for the chosen strategy - Handle any conflicts that arise - Confirm changes before final commit

  1. Post-merge summary: Display what was merged:

- Files changed/added/removed - Source worktree/branch - Merge strategy used

  1. Cleanup prompt: After successful merge, ask:

- "Would you like to remove any worktrees to clean up local state?" - If yes: List worktrees and ask which to remove - Execute git worktree remove <path> for selected worktrees - Remind about git worktree prune if needed

Merge Strategies Reference

StrategyUse WhenCommand Pattern
Selective FileNeed complete file(s) from another branchgit checkout <branch> -- <path>
Interactive PatchNeed specific changes within a filegit checkout -p <branch> -- <path>
Cherry-Pick SelectiveNeed a commit but not all its changesgit cherry-pick --no-commit + selective staging
Manual MergeFull branch merge with controlgit merge --no-commit + selective staging
Multi-SourceCombining files from multiple branchesMultiple git checkout <branch> -- <path>

Examples

Merge single file from worktree:

> /git:merge-worktree src/app.js --from ../project-feature
# Prompts for merge strategy
# Executes: git checkout feature-branch -- src/app.js

Interactive patch selection:

> /git:merge-worktree src/utils.js --patch
# Lists available worktrees to select from
# Runs: git checkout -p feature-branch -- src/utils.js
# User selects hunks interactively (y/n/s/e)

Cherry-pick specific commit:

> /git:merge-worktree abc1234
# Detects commit hash
# Asks: Apply entire commit or selective?
# If selective: git cherry-pick --no-commit abc1234
# Then guides through unstaging unwanted changes

Merge from multiple worktrees:

> /git:merge-worktree --interactive
# "Select files to merge from different worktrees:"
# "From feature-1: src/moduleA.js"
# "From feature-2: src/moduleB.js, src/moduleC.js"
# Executes selective checkouts from each

Full guided mode:

> /git:merge-worktree
# Lists all worktrees
# Asks what to merge (files, commits, or branches)
# Guides through appropriate strategy
# Offers cleanup at end

Directory merge with conflicts:

> /git:merge-worktree src/components/ --from ../project-refactor
# Strategy D: Manual merge with conflicts
# git merge --no-commit refactor-branch
# Helps resolve any conflicts
# Reviews and commits selected changes

Interactive Patch Mode Guide

When using --patch or Strategy B, the user sees prompts for each change hunk:

@@ -10,6 +10,8 @@ function processData(input) {
   const result = transform(input);
+  // Added validation
+  if (!isValid(result)) throw new Error('Invalid');
   return result;
 }
Apply this hunk? [y,n,q,a,d,s,e,?]
KeyAction
yApply this hunk
nSkip this hunk
qQuit (don't apply this or remaining hunks)
aApply this and all remaining hunks
dDon't apply this or remaining hunks in this file
sSplit into smaller hunks
eManually edit the hunk
?Show help

Cherry-Pick Selective Workflow

For Strategy C (cherry-picking with selective staging):

# 1. Apply commit without committing
git cherry-pick --no-commit abc1234

# 2. Check what was staged
git status

# 3. Unstage files you don't want
git reset HEAD -- path/to/unwanted.js

# 4. Discard changes to those files
git checkout -- path/to/unwanted.js

# 5. Commit the remaining changes
git commit -m "Cherry-pick selected changes from abc1234"

Multi-Worktree Merge Workflow

For Strategy E (merging from multiple worktrees):

# Get files from different branches
git checkout feature-auth -- src/auth/login.js src/auth/session.js
git checkout feature-api -- src/api/endpoints.js
git checkout feature-ui -- src/components/Header.js

# Review all changes
git status
git diff --cached

# Commit combined changes
git commit -m "feat: combine auth, API, and UI improvements from feature branches"

Common Workflows

Take a Feature File Without Full Merge

> /git:merge-worktree src/new-feature.js --from ../project-feature
# Gets just the file, not the entire branch

Partial Bugfix from Hotfix Branch

> /git:merge-worktree --patch src/utils.js --from ../project-hotfix
# Select only the specific bug fix hunks, not all changes

Combine Multiple PRs' Changes

> /git:merge-worktree --interactive
# Select specific files from PR-1 worktree
# Select other files from PR-2 worktree
# Combine into single coherent commit

Pre-Merge Review

# First review what will be merged
> /git:compare-worktrees src/module.js
# Then merge with confidence
> /git:merge-worktree src/module.js --from ../project-feature

Important Notes

  • Working directory state: Always ensure your working directory is clean before merging. Uncommitted changes can cause conflicts.
  • Pre-merge review: Consider using /git:compare-worktrees before merging to understand what changes will be applied.
  • Conflict resolution: If conflicts occur during merge, the command will help identify and resolve them before committing.
  • No-commit flag: Most strategies use --no-commit to give you control over the final commit message and what gets included.
  • Shared repository: All worktrees share the same Git object database, so commits made in any worktree are immediately visible to cherry-pick from any other.
  • Branch locks: Remember that branches can only be checked out in one worktree at a time. Use branch names for merge operations rather than creating duplicate worktrees.

Cleanup After Merge

After merging, consider cleaning up worktrees that are no longer needed:

# List worktrees
git worktree list

# Remove specific worktree (clean state required)
git worktree remove ../project-feature

# Force remove (discards uncommitted changes)
git worktree remove --force ../project-feature

# Clean up stale worktree references
git worktree prune

The command will prompt you about cleanup after each successful merge to help maintain a tidy workspace.

Troubleshooting

"Cannot merge: working directory has uncommitted changes"

  • Commit or stash your current changes first
  • Or use git stash before merge, git stash pop after

"Merge conflict in "

  • The command will show conflicted files
  • Open files and resolve conflicts (look for <<<<<<< markers)
  • Stage resolved files with git add <file>
  • Continue with git commit

"Commit not found" when cherry-picking

  • Ensure the commit hash is correct
  • Run git log <branch> in any worktree to find commits
  • Commits are shared across all worktrees

"Cannot checkout: file exists in working tree"

  • File has local modifications
  • Either commit, stash, or discard local changes first
  • Then retry the merge operation

"Branch not found for worktree"

  • The specified worktree may have been removed
  • Run git worktree list to see current worktrees
  • Use git worktree prune to clean up stale references

Integration with Other Commands

Pre-merge review:

> /git:compare-worktrees src/
> /git:merge-worktree src/specific-file.js

Create worktree, merge, cleanup:

> /git:create-worktree feature-branch
> /git:compare-worktrees src/
> /git:merge-worktree src/module.js --from ../project-feature-branch
# After merge, cleanup is offered automatically

平台分布

Codex

38.78%
按下载量换算1,455

Claude

30.57%
按下载量换算1,147

Cursor

19.56%
按下载量换算734

Gemini CLI

8.95%
按下载量换算336

安全审计

暂无安全审计结果可展示。

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills