用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tomevault-io/skills-registry --skill git-conflicts命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | git-conflicts |
| description | Guided conflict resolution for merge and rebase conflicts Use when this capability is needed. |
| metadata | {"author":"dtsong"} |
git addgit merge --continue or git rebase --continue after resolution--file): reject .. traversal, null bytes, and shell metacharacters. Must be a path within the repository working tree.Get help resolving merge, rebase, or cherry-pick conflicts.
/git-conflicts # Analyze and help with current conflicts
/git-conflicts --status # Show conflict status only
/git-conflicts --file src/component.tsx # Focus on specific file
# Check what operation is in progress
if [ -d .git/rebase-merge ] || [ -d .git/rebase-apply ]; then
OPERATION="rebase"
elif [ -f .git/MERGE_HEAD ]; then
OPERATION="merge"
elif [ -f .git/CHERRY_PICK_HEAD ]; then
OPERATION="cherry-pick"
else
echo "No conflicts detected."
exit 0
fi
# Get list of conflicting files
CONFLICTS=$(git diff --name-only --diff-filter=U)
echo "Conflicting files:"
echo "$CONFLICTS"
# Count conflicts
COUNT=$(echo "$CONFLICTS" | wc -l)
echo "Total: $COUNT files with conflicts"
For each conflicting file, Claude will:
<<<<<<<, =======, >>>>>>>)Provide clear instructions for each file.
Conflict Resolution Guide
Operation: Merging main into feat/dark-mode
Conflicting files (2):
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1. src/components/Header.tsx
Conflict type: Both branches modified the same lines
Your changes (HEAD):
- Added dark mode toggle button
- Changed header background color
Their changes (main):
- Updated logo component
- Changed header padding
Suggested resolution:
Keep both changes - they affect different aspects.
1. Keep the dark mode toggle (your change)
2. Keep the logo update (their change)
3. Merge the style changes carefully
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2. src/styles/theme.css
Conflict type: Same CSS property modified differently
Your changes (HEAD):
--header-bg: #1a1a2e; /* dark mode */
Their changes (main):
--header-bg: #ffffff; /* light mode default */
Suggested resolution:
Both are needed! Create theme variants:
:root {
--header-bg: #ffffff;
}
[data-theme="dark"] {
--header-bg: #1a1a2e;
}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Next steps:
1. Edit conflicting files (remove conflict markers)
2. git add <resolved-files>
3. git merge --continue (or git rebase --continue)
Or abort:
/git-abort
When focusing on a specific file:
Analyzing: src/components/Header.tsx
Conflict region 1 (lines 45-62):
<<<<<<< HEAD (your changes)
import { ThemeToggle } from './ThemeToggle';
export function Header() {
return (
<header className="bg-slate-900 dark:bg-slate-950">
<Logo />
<ThemeToggle />
=======
import { NewLogo } from './NewLogo';
export function Header() {
return (
<header className="bg-white p-4">
<NewLogo />
>>>>>>> main (their changes)
Analysis:
- You added ThemeToggle import and component
- They updated Logo to NewLogo
- Background colors differ (you: dark, they: light default)
Resolution suggestion:
Combine both changes:
import { ThemeToggle } from './ThemeToggle';
import { NewLogo } from './NewLogo';
export function Header() {
return (
<header className="bg-white dark:bg-slate-950 p-4">
<NewLogo />
<ThemeToggle />
Keep your version, discard theirs.
git checkout --ours <file>
git add <file>
Keep their version, discard yours.
git checkout --theirs <file>
git add <file>
Edit file to combine both changes (most common).
# Edit file to resolve
vim <file>
git add <file>
git mergetool <file>
| Pattern | Typical Resolution |
|---|---|
| Same line, different changes | Manual merge combining intent |
| Deleted vs modified | Decide if deletion or modification wins |
| Added file in both | Merge contents or pick one |
| Renamed differently | Pick the better name, merge content |
| Structural refactor | Usually accept refactor, reapply changes |
# Mark as resolved
git add <resolved-file>
# Continue the operation
git merge --continue # for merge
git rebase --continue # for rebase
git cherry-pick --continue # for cherry-pick
/git-abort if conflicts are too complex/git-merge-main or /git-rebase to start merge/rebase/git-push to update remoteConverted and distributed by TomeVault — claim your Tome and manage your conversions.