git-state-safety

Inspect other refs read-only during Git merge, rebase, or cherry-pick conflicts.

4|1|Updated Mar 11, 2026
One-click install
npx skills add https://github.com/jcdendrite/claude-config --skill git-state-safety
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: git-state-safety
Source: https://github.com/jcdendrite/claude-config/tree/main/claude/.claude/skills/git-state-safety
Command: npx skills add https://github.com/jcdendrite/claude-config --skill git-state-safety

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prevents silent Git index corruption when you inspect another ref during a merge, rebase, or cherry-pick with unresolved conflicts.

Core Features & Use Cases

  • Read-only cross-ref inspection: Uses safe commands (e.g., show, cat-file, log, diff, blame, ls-tree) to compare another ref’s content without mutating the index.
  • Conflict-stage awareness: Explains stage 1/2/3 so you can understand and safely resolve per-path conflicts using --ours or --theirs.
  • Safety rules and recovery recipes: Identifies unsafe mutations (like git checkout <ref> -- <path> or git add during conflicts) and provides recovery steps using abort or reset/repair commits depending on push status.

Quick Start

Ask the AI to help you inspect a file from origin/main while you are in the middle of a merge with unresolved conflicts, using only read-only commands and avoiding any index-overwriting operations.

Frequently Asked Questions about git-state-safety

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I inspect files from another branch during a merge conflict without corrupting the index?▼

To inspect files safely during a merge conflict, use read-only commands like git show, cat-file, or git diff instead of index-mutating operations. This prevents silent index corruption by avoiding modifications to unmerged entries while viewing other refs.

What Git commands are safe to run while resolving rebase conflicts?▼

Safe Git commands during rebase conflicts include ref-scoped read operations such as git log, git blame, ls-tree, and ls-files -u. These allow you to compare history and diffs across refs without overwriting conflicted index stages.

Why does checking out a file from another ref break my conflicted Git repository?▼

Checking out a file from another ref breaks a conflicted repository because git checkout overwrites index stages. During merge or cherry-pick states, this mutates unmerged entries and causes silent index corruption instead of resolving the conflict.

How do I compare file content across refs during a cherry-pick conflict?▼

You can compare file content across refs during a cherry-pick conflict using read-only commands like git show or git diff. These commands inspect the target ref's content directly without altering the unmerged index entries.

What do stage 1, 2, and 3 mean when resolving Git merge conflicts?▼

Stage 1, 2, and 3 in Git merge conflicts represent the base, ours, and theirs versions of unmerged paths. Understanding these stages allows you to use --ours or --theirs to resolve per-path conflicts safely.