用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tenfyzhong/skills-hub --skill resolve-git-conflicts命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | resolve-git-conflicts |
| description | Resolve Git conflicts from merge, rebase, cherry-pick, or stash operations. |
Resolve Git conflicts end-to-end in the CLI. Analyze base/ours/theirs, decide which changes to keep or combine, verify the code works, then stop for human review before any commit or continue.
git status -sbgit diff --name-only --diff-filter=Ugit show :1:PATH, git show :2:PATH, git show :3:PATHgit add PATHgit commit, git merge --continue, git rebase --continue, or git cherry-pick --continuegit status -sb and git log --oneline --decorate -n 20 to identify the operation and the competing commits.git show :1:PATH (base), :2: (ours), :3: (theirs). Use git diff --ours PATH and git diff --theirs PATH to see intent.ours, theirs, or a combined result based on the decision framework. Prefer minimal, intention-preserving edits. Do not ask the user to edit; apply the changes directly and record the rationale in your response.git commit, git merge --continue, git rebase --continue, or git cherry-pick --continue. Provide a short summary of decisions and files touched for review.Do not default to ours or theirs. Decide per file using evidence.
Questions to answer before choosing:
Interpretation notes:
ours is the current branch and theirs is the merged-in branch.ours is the branch you are applying onto and theirs is the commit being applied.| Goal | Command |
|---|---|
| List conflicted files | git diff --name-only --diff-filter=U |
| See conflict markers | `rg -n "<<<<<<< |
| Show base/ours/theirs | git show :1:PATH, git show :2:PATH, git show :3:PATH |
| Diff ours vs file | git diff --ours PATH |
| Diff theirs vs file | git diff --theirs PATH |
| Accept ours/theirs quickly | git checkout --ours PATH, git checkout --theirs PATH |
| Stage resolution | git add PATH |
If rg is unavailable, use grep -n "<<<<<<<\\|======\\|>>>>>>>" PATH.
Conflict:
function formatUser(user) {
<<<<<<< HEAD
return `${user.name} <${user.email}>`;
=======
return `${user.displayName} <${user.email}>`;
>>>>>>> feature/use-display-name
}
Resolved (use new field, keep fallback):
function formatUser(user) {
const name = user.displayName ?? user.name;
return `${name} <${user.email}>`;
}
Rationale: the feature branch introduced displayName, but existing callers may still populate name.
ours and theirs as fixed to "my branch" and "their branch" in all operations.