fix-git-error

A guide for diagnosing and fixing common Git and repository errors. Git is the version-control tool used to track code changes and share them with others.

In plain words
What is it for?
Use it to gather Git status and remote details, inspect recent commits, handle network or authentication problems, and resolve merge or rebase conflicts.
Why use it?
It provides a repeatable way to understand failures involving branches, merges, pushes, permissions, repository data, large files, or submodules before choosing a fix.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/darknodebros/elesync/fix-git-error
Any agent
npx skills add darknodebros/EleSync --skill fix-git-error
Clone the repo
git clone --depth 1 https://github.com/darknodebros/EleSync

Made for: Claude Code, Codex.

Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,520 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00058 $0.01520
Opus 5 $0.00029 $0.00760
Sonnet 5 $0.00012 $0.00304
Haiku 4.5 $0.00006 $0.00152

Measured yesterday against content hash 84c17b222dbc, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

fix-git-error 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 yesterday.

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.

.github/skills/fix-git-error/SKILL.md · 126 lines

How it starts

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

workflow:

  • name: Gather context steps:

    • Ask for the exact error message and the command that produced it.
    • Ask for the current branch: git branch --show-current and status: git status --porcelain --branch.
    • Ask whether other collaborators see the same issue and whether CI is failing.
  • name: Local quick checks steps:

    • Run git status and git rev-parse --abbrev-ref HEAD.
    • Inspect last commits: git log --oneline -n 10.
    • Check remotes: git remote -v and git ls-remote --heads origin.
  • name: Decide branch safety decision_points:

    • condition: "Working tree clean and no local-only commits" action: "Prefer safe remote-sync commands (fetch, pull)"
    • condition: "Uncommitted work present" action: "Stash or commit before aggressive operations"
  • name: Common remediation paths cases:

    • title: "Network / auth errors" steps:

      • Check git remote -v and try git fetch --all.
      • Validate credentials: ask to try git fetch with GIT_TRACE=1 if needed.
      • If using SSH, confirm ssh -T [email protected] works.
    • title: "Merge / rebase conflicts" steps:

      • Run git status to see conflicting files.
      • Use git mergetool or manual resolution, then git add + git rebase --continue or git commit.
      • If rebase is too complex, suggest git rebase --abort and use a merge instead.
    • title: "Corrupt refs / missing objects" steps:

      • Run git fsck --full to surface corruption.
      • Try git reflog to find a recoverable commit.
      • If necessary, fetch a fresh copy: clone the repo into a temporary directory and compare.
    • title: "Large File / LFS problems" steps:

      • Verify LFS is installed: git lfs version.
      • Run GIT_TRANSFER_TRACE=1 git push for diagnostics.
  • name: Aggressive recovery (when safe) steps:

    • Create a backup: git bundle create ../repo-backup.bundle --all or git clone --mirror . ../repo-mirror
    • If local history is irrecoverable, reclone: git clone <url> tmp && mv tmp/.git . && git reset --hard origin/<branch>

quality_criteria:

  • The repository reports a clean working tree: git status shows nothing to commit.
  • The branch can fetch and push successfully: git fetch --all and git push return success.
  • CI or downstream checks that failed because of the repo error are re-run and pass (if applicable).

verification:

  • Confirm git status --porcelain is empty.
  • Confirm git rev-parse origin/$(git rev-parse --abbrev-ref HEAD) succeeds.
  • If changes were rewritten (rebase/force-push), ensure collaborators are informed and given instructions to synchronize (e.g., git fetch && git reset --hard origin/<branch>).

examples_and_prompts:

  • Example user prompt: "I'm getting 'error: failed to push some refs' after a merge — please help."
  • Agent prompt to run: "Collect git status --porcelain --branch, git log -n 5 --oneline, and the exact failing command and error output. Then run git fetch --all and report results."

notes:

  • Prefer conservative fixes first (stash/commit, fetch, merge) before destructive actions.
  • Always create a backup bundle or mirror before attempting destructive recovery.
  • For workspace-scoped customization, add repository-specific checks (e.g., submodules, LFS, CI hooks) to the workflow section.

project_specific_checks: description: | EleSync-specific checks and commands to run when diagnosing repository or release-related errors. checks: - name: CI matrix and test command command: | - CI runs on Python 3.10–3.14. Run tests locally the same way: python -m unittest discover -s tests -v

- name: Install extras for optional tests
  command: |
    - The project defines optional extras in `pyproject.toml` (e.g. `mcp`, `encryption`, `watch`, `webauth`, `semantic`).
    - To replicate CI's `test-extras` job: `pip install -e ".[dev]"` then run the test command above.

Read the full file on GitHub · 126 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. yesterday First seen · 126 lines · 58 tokens per session scan A 84c17b222dbc

Subscribe to this mod's changes

fix-git-error is a skill published in the GitHub repository darknodebros/EleSync (4 stars, last pushed yesterday), licensed MIT. It adds 58 tokens to every session and 1,520 once invoked, about $0.0003 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

geo-platform-optimizer

Platform-specific AI search optimization — audit and optimize for Google AI Overviews, ChatGPT, Perplexity, Gemini, and Bing Copilot individually.

zubair-trabzada/geo-seo-claude · 34 tokens

composio

Route and complete Composio work across Composio For You and Composio Platform. Use when the user mentions Composio; wants an agent to use apps such as Gmail, Slack, GitHub, Notion, Calendar, or Linear; needs first-time setup, an SDK or MCP integration, CLI operation, migration guidance, current documentation, or help…

elie222/rakazo · 84 tokens

bugs

Proactively sweep a Pake area for latent UX and runtime defects before users report them, using this repo's own fix history and boundary archetypes, and confirm every finding with a probe run this turn. Use for 找找有没有bug, 主动找bug, 有没有隐患, 排查隐患, 举一反三, 上线前扫一遍, 这块可靠吗, latent bug scan, sibling sweep after a fix. Not for an…

tw93/Pake · 0 tokens

release

Prepare, validate, and publish a Pake release. Not for version bumps without release intent.

tw93/Pake · 21 tokens

pake

Package any website or local web build into a lightweight desktop app using Pake (Tauri/Rust). Use when the user wants to: wrap a URL as a native app, build a desktop app from a website or a local dist/ folder, use Pake CLI to package a page, set up proxy for a packaged app, customize app icons or bundle IDs, or…

tw93/Pake · 119 tokens

ima2

Use the ima2-gen CLI/server to generate, edit, inspect, and manage local AI image generation jobs.

lidge-jun/ima2-gen · 25 tokens