# Fix Git Issues

> Diagnose and fix git state problems

- Skill: `emaraschio/fix-git-issues` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx skillmds@latest add emaraschio/fix-git-issues`
- Raw SKILL.md: https://api.skillmd.com/api/skills/emaraschio/fix-git-issues/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: emaraschio (https://skillmd.com/u/emaraschio)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/emaraschio/fix-git-issues

---

## Overview

Help resolve common Git problems and conflicts with step-by-step commands and explanations for each situation.

## Steps

1. **Merge Conflicts**
    - Analyze conflicting changes and their context
    - Provide resolution strategies for different conflict types
    - Suggest the best approach to preserve important changes
    - Generate resolved code maintaining functionality
2. **Branch Management**
    - Help with branch cleanup and organization
    - Suggest rebasing vs merging strategies
    - Assist with cherry-picking specific commits
    - Guide through complex branch operations
3. **Commit History**
    - Help with commit message improvements
    - Assist with squashing and organizing commits
    - Guide through interactive rebase operations
    - Fix commit authorship and metadata
4. **Repository Issues**
    - Help recover from detached HEAD state
    - Assist with undoing commits and changes
    - Guide through stash management
    - Resolve submodule and remote issues

## Git Issues Checklist

- [ ] Problem identified and analyzed
- [ ] Git commands provided with explanations
- [ ] Resolution strategy validated
- [ ] Changes tested and verified
- [ ] Repository state clean and functional

## Guardrails

- Get explicit consent before destructive git commands (reset, rebase, or history rewrite).
- Never force-push main or a shared branch without an explicit request.
- Explain each command before running it.
- Never print or commit secrets or credential files (.env, .env.*, keys); flag any exposure instead of committing it.
