sijiaoh/pockode/merge

Claude Code and agent skill by sijiaoh/pockode

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

把指定分支合并进当前分支,并解决冲突。用于 "/merge [branch]"、"合并 main"、"把某分支合进来"、以及 merge 冲突需要处理的场景。默认合并 main。

Install

npx vskill@latest install sijiaoh/pockode/merge

SKILL.md

Merge

把 $ARGUMENTS 指定的分支合并进当前分支;未指定时合并 main。

核心原则:合并结果必须同时包含双方的改动。 冲突不是二选一,是把两边的意图合成一份代码。

流程

- [ ] 1. 确认工作区干净
- [ ] 2. 执行 merge
- [ ] 3. 逐个解决冲突
- [ ] 4. 检查语义冲突
- [ ] 5. 跑校验
- [ ] 6. 提交
1. 确认工作区干净

git status。有未提交改动就先提交(不要用 git stash,stash 栈在所有 worktree 间共享)。 要合入远程分支时先 git fetch。

2. 执行 merge
bash
git merge <branch>

无冲突直接跳到第 4 步。

3. 逐个解决冲突

先搞清楚两边各自想做什么,再动手:

bash
git log --oneline HEAD..MERGE_HEAD # 对方带来了哪些提交
git diff HEAD...MERGE_HEAD -- <file> # 对方在这个文件上的完整改动
git show :1:<file> # 共同祖先(:2: 我方,:3: 对方)

解决时:

  • 默认两边都保留。一方重构函数、另一方加了新调用点 —— 结果是重构后的函数 + 适配过的新调用点,而不是丢掉一边。
  • 禁止 `git checkout --ours/--theirs` 整文件覆盖,除非确认该文件被单方面整体重写。
  • 锁文件不手改:pnpm-lock.yaml 用 pnpm install 重新生成,go.sum 用 go mod tidy 重新生成。
  • 一方删除、另一方修改(DU / UD / 重命名冲突)最容易丢改动:先弄清删除方是"整体移走了"还是"不再需要"。移走了就把修改搬到新位置,不能直接接受删除。
  • 判断不了对方意图时不要猜:git merge --abort 回到干净状态,向用户说明是哪个文件、两边分别在做什么,再决定。留一个半成品的合并比中止更糟。

解决完 git add <file>,再确认两件事:

bash
git diff --name-only --diff-filter=U # 还有未解决的路径吗
git grep -n '^<<<<<<< ' # 冲突标记被 add 进去后 git 就不再报了
4. 检查语义冲突

git 不报冲突不等于代码正确 —— 一方改了签名 / 重命名 / 删除,另一方新增的调用点不会产生冲突标记。 对双方都碰过的符号做一次全仓搜索,确认调用方和定义一致。

5. 跑校验
bash
pnpm run lint
pnpm -r run test
(cd server && go test ./...)

失败先判断是不是合并引入的(docs/testing.md 有区分方法),不要直接改测试让它变绿。

6. 提交

保留默认的 Merge branch 'xxx' 提交信息。冲突解决只做"让双方改动共存"这一件事,不要顺手改行为、删代码或重构。

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
56
Repository forks
6
7-day trend score
25

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/sijiaoh/pockode/merge/badge)](https://verified-skill.com/skills/sijiaoh/pockode/merge)

Something wrong with this skill or its page? Tell us.