git-troubleshooter

git-troubleshooter is a skill for Claude Code from an8079/take-skills. It costs 39 tokens per session (1,353 once invoked), scanned A, original, MIT.

A troubleshooting guide for Git, the version-control system used to track code changes. It covers conflicts, undoing commits, branch cleanup, cherry-picking changes, and recovering deleted work with the reflog.

In plain words
What is it for?
Use it when Git operations fail, branches become confusing, changes need to be undone, commits must be moved, or deleted work needs recovery.
Why use it?
It helps diagnose common Git errors and choose an appropriate recovery method. It also distinguishes safer ways to undo changes from operations that can discard local work.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the claude-dev-assistant plugin — 21 skills, 39 commands shipped together

Good fit Use it when Git operations fail, branches become confusing, changes need to be undone, commits must be moved, or deleted work needs recovery.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/an8079/take-skills/git-troubleshooter
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add an8079/take-skills --skill git-troubleshooter
Clone the repo
git clone --depth 1 https://github.com/an8079/take-skills

Made for: Claude Code.

Or install claude-dev-assistant, the plugin that ships this one along with the rest of its 21 skills, 39 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for git-troubleshooter

README.md
[![agentmods](https://agentmods.dev/badge/skills/an8079/take-skills/git-troubleshooter/github.svg)](https://agentmods.dev/skills/an8079/take-skills/git-troubleshooter)
Your own site
<a href="https://agentmods.dev/skills/an8079/take-skills/git-troubleshooter"><img src="https://agentmods.dev/badge/skills/an8079/take-skills/git-troubleshooter/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for git-troubleshooter

Your own site · 80×15
<a href="https://agentmods.dev/skills/an8079/take-skills/git-troubleshooter"><img src="https://agentmods.dev/badge/skills/an8079/take-skills/git-troubleshooter.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,353 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00039 $0.01353
Opus 5 $0.00019 $0.00677
Sonnet 5 $0.00008 $0.00271
Haiku 4.5 $0.00004 $0.00135

Measured 10d ago against content hash a46bca7dfdaa, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

git-troubleshooter scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/git-troubleshooter/SKILL.md · 228 lines

How it starts

The opening of the file, as written. The whole thing — 228 lines — stays where its author put it; the contents beside it link to each section on GitHub.

git-troubleshooter — Git故障排查员

Git出问题了别慌!这个skill帮你诊断并修复所有常见Git疑难杂症。

触发条件

  • Git操作报错(冲突、失败、拒绝等)
  • 需要回退到之前的版本
  • 分支混乱,需要清理
  • 误删内容想要恢复

工具列表

主要使用 exec 工具执行Git命令


常见问题急救手册

1. 合并冲突(Merge Conflict)

识别

<<<<<<< HEAD
当前分支的内容
=======
 incoming分支的内容
>>>>>>> feature-branch

解决方法(三步走)

步骤1:查看冲突文件

git status  # 列出所有冲突文件
git diff --name-only --diff-filter=U  # 仅列出有冲突的文件

步骤2:手动解决冲突 编辑冲突文件,保留需要的部分,删除 <<<<<<<=======>>>>>>> 标记

步骤3:标记解决完成

git add <冲突文件>
git commit -m "fix: resolve merge conflict in XXX"

快捷工具

# 用ours/theirs快速选择
git checkout --ours <file>   # 保留当前分支版本
git checkout --theirs <file>  # 保留合并分支版本

# 或用git checkout的保留策略
git merge -X ours <branch>    # 自动用ours策略合并
git merge -X theirs <branch>   # 自动用theirs策略合并

2. 想回退(Reset/Revert)

场景A:还没push,想重置本地

# 回退最近1次提交,保留改动
git reset --soft HEAD~1

# 回退最近1次提交,不保留改动(危险!)
git reset --hard HEAD~1

# 回退到指定commit
git reset --hard <commit-hash>

场景B:已经push了,想撤销

# 安全撤销:创建新提交来"反做"指定提交
git revert <commit-hash>

# 撤销最近1次提交
git revert HEAD

场景C:想回到某个tag

git reset --hard v1.0.0
git push --force origin <branch>

3. 误删了分支,想恢复

# 找到丢失分支的commit
git reflog
# 输出示例:
# abc1234 HEAD@{0}: checkout: moving from feature-x to main
# def5678 HEAD@{1}: commit: add new feature

# 恢复分支
git checkout -b <分支名> <commit-hash>
# 示例:
git checkout -b feature-x def5678

或者用 HEAD@{n} 直接恢复

git checkout -b recovered-branch HEAD@{5}

4. Rebase冲突中断

停在了冲突点

# 解决完冲突后
git add .
git rebase --continue

# 想放弃rebase,恢复原状
git rebase --abort

已经手动reset了?用reflog恢复

git reflog | grep rebase
git reset --hard ORIG_HEAD

5. 修改了不想提交的改动,想stash

# 暂存当前改动
git stash
git stash save "临时stash: XXX改动"

# 查看暂存列表
git stash list

# 恢复最新stash
git stash pop

# 恢复指定stash
git stash apply stash@{0}

# 删除stash
git stash drop stash@{0}

6. 想撤销某次文件的修改

Read the full file on GitHub · 228 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 228 lines · 39 tokens per session scan A a46bca7dfdaa

Subscribe to this mod's changes

git-troubleshooter is a skill published in the GitHub repository an8079/take-skills (4 stars, last pushed 5mo ago), licensed MIT. It adds 39 tokens to every session and 1,353 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

agent-merge-conflict-arbiter

Neutral arbiter for merge conflicts between two agents.

NousResearch/hermes-agent · 19 tokens

git-advanced-workflows

Master advanced Git workflows including rebasing, cherry-picking, bisect, worktrees, and reflog to maintain clean history and recover from any situation. Use when managing complex Git histories, collaborating on feature branches, or troubleshooting repository issues.

wshobson/agents · 54 tokens

bisect

Bisect regressions or broken builds in the Chromium repository using deterministic binary search, checking out midpoint commits, syncing dependencies with gclient sync, compiling the target with autoninja, and querying the user for test results until the culprit commit is isolated.

chromium/chromium · 52 tokens

mantis-critic

Assesses the production viability of findings, filtering out debug-only features and assertion traps. Use when findings have been validated and you need to confirm they are triggerable in production release builds (with assertions disabled). Don't use for writing reproduction scripts or patches.

google/mantis · 55 tokens

hotpath_bump

Bump the hotpath version number across the workspace and related files. Updates crate versions in Cargo.toml files (exact patch version) and version references in the backend middleware, hotpathinit skill, and README (major.minor only). Use when the user wants to bump, bump the version, or release a new hotpath…

pawurb/hotpath-rs · 73 tokens

comet-github-issue-fix

A workflow for fixing a confirmed Comet-related GitHub issue or review blocker within an isolated scope. It covers matching the work to the relevant workflow, testing the change, checking runtime results, and preparing a careful handoff.

rpamis/comet · 71 tokens