git-expert

Diagnose and resolve Git merge conflicts, history rewrites, and repository recovery issues.

3|Updated Jan 15, 2026
One-click install
npx skills add https://github.com/trudyan141/my-antigravity-agents-kit --skill git-expert-trudyan141
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-expert
Source: https://github.com/trudyan141/my-antigravity-agents-kit/tree/main/templates/.agent/skills/git-expert
Command: npx skills add https://github.com/trudyan141/my-antigravity-agents-kit --skill git-expert-trudyan141

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It resolves complex Git problems such as merge conflicts, lost commits, corrupted repositories, and failed pushes that block development workflows and risk losing work. ## Core Features & Use Cases - Conflict Resolution & Branching: Diagnose merge conflicts, apply resolution strategies (ours/theirs/manual), and implement GitFlow, GitHub Flow, or GitLab Flow branching models. - History Rewriting & Recovery: Perform interactive rebases, squash commits, recover lost commits via reflog, and restore deleted branches or stashes safely with backups. - Performance & Security: Configure Git LFS for large files, optimize clones with shallow or blobless strategies, remove secrets from history, and set up GPG commit signing. - Use Case: A developer hits "refusing to merge unrelated histories" while combining two repositories. The Skill diagnoses the root cause, applies --allow-unrelated-histories with a backup branch, and validates repository integrity afterward. ## Quick Start Use the git-expert skill to resolve the merge conflict in my current branch and verify the repository is clean afterward.

Frequently Asked Questions about git-expert

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

FAQPage Schema
How do I resolve Git merge conflicts?

Identify conflicted files with git status, then edit conflict markers manually or use git mergetool. Stage resolved files with git add and commit. For bulk resolution, use git merge -X ours or -X theirs to prefer one side.

How do I recover a lost commit or deleted branch in Git?

Use git reflog to find the commit hash of the lost work, then run git branch <name> <hash> to restore a branch or git reset --hard <hash> to return to that state. Reflog retains entries even after resets and rebases.

What is the difference between git merge and git rebase?

Merge preserves branch history by creating a merge commit, while rebase replays commits onto a new base for a linear history. Use merge for shared branches and rebase for cleaning up local feature branches before integrating.

Why does git push fail with 'failed to push some refs'?

This happens when the remote contains commits your local branch lacks. Run git pull --rebase to integrate remote changes, then push again. If force pushing is required, use --force-with-lease instead of --force for safety.

How do I remove secrets from Git history?

Use BFG Repo-Cleaner or git filter-branch to delete sensitive files from all commits, after creating a backup. Then add patterns like *.env and *.key to .gitignore and rotate any exposed credentials immediately.

When should I use Git LFS for large files?

Use Git LFS when tracking binary files like images, videos, or archives that bloat repository size. Configure it with git lfs track for file patterns, and migrate existing files using git lfs migrate import.