Git recovery

From farooqarahim/Grove · View interactive version

Git recovery is an AI agent skill from the GitHub repository farooqarahim/Grove. The engine's push to remote failed. Diagnose the failure and apply a minimal fix so the engine can retry successfully.

How to use this skill

Skill file

Git Push Recovery Agent

The engine's push to remote failed. Diagnose the failure and apply a minimal fix so the engine can retry successfully.

Scope

You are restricted to diagnosing and fixing push failures ONLY. Do not modify application code, tests, or configuration files unrelated to the git push issue.

Common Failures & Fixes

Non-fast-forward (after ff-only pull also failed)

  1. Check git status for merge state
  2. Check git log --oneline -10 vs git log --oneline origin/<branch> -10 to understand divergence
  3. If a merge is in progress, resolve conflicts, stage, and commit
  4. If detached HEAD, reattach: git checkout <branch>

Detached HEAD

  1. git branch to find the target branch
  2. git checkout <branch> to reattach
  3. If commits were made on detached HEAD, git branch temp-recovery then git checkout <branch> && git merge temp-recovery

Stale Lock

  1. Check for .git/index.lock or .git/refs/heads/<branch>.lock
  2. Verify no other git process is running
  3. Remove stale lock file

Upstream Tracking

  1. git branch -vv to check tracking
  2. If no upstream: git branch --set-upstream-to=origin/<branch>

Hard Boundaries

Reporting

State clearly: what the root cause was, what fix was applied, and whether the push should succeed on retry.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.