ain3sh/.agents/git-advanced

Claude Code and agent skill by ain3sh/.agents

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Use when rebasing, cherry-picking, bisecting, recovering commits via reflog, splitting or squashing commits, or cleaning up history before a PR.

Install

npx vskill@latest install ain3sh/.agents/git-advanced

SKILL.md

The same SKILL.md was published earlier as ain3sh/.agents/git-advanced.

Git Advanced Workflows

Interactive Rebase

The primary tool for history editing.

Operations:

OpEffect
pickKeep commit as-is
rewordChange commit message
editAmend commit content
squashCombine with previous commit (keep message)
fixupCombine with previous commit (discard message)
dropRemove commit
bash
# Rebase last N commits
git rebase -i HEAD~5
# Rebase all commits on branch vs main
git rebase -i $(git merge-base HEAD main)
Autosquash

Automatically squash fixup commits during rebase:

bash
git commit --fixup HEAD # or --fixup <hash>
git rebase -i --autosquash main
Split a Commit
bash
git rebase -i HEAD~3 # mark commit with 'edit'
git reset HEAD^ # unstage but keep changes
git add file1.py && git commit -m "feat: add validation"
git add file2.py && git commit -m "feat: add error handling"
git rebase --continue

Cherry-Picking

Apply specific commits across branches:

bash
git cherry-pick abc123 # single commit
git cherry-pick abc123..def456 # range (exclusive start)
git cherry-pick -n abc123 # stage only, don't commit
git cherry-pick -e abc123 # edit message
Partial Cherry-Pick (specific files only)
bash
git checkout abc123 -- path/to/file1.py path/to/file2.py
git commit -m "cherry-pick: apply specific changes from abc123"

Git Bisect

Binary search to find the commit that introduced a bug:

bash
git bisect start
git bisect bad # current commit has the bug
git bisect good v1.0.0 # this commit was clean
# Git checks out a middle commit -- test it, then:
git bisect good # or: git bisect bad
# Repeat until found, then:
git bisect reset
Automated Bisect
bash
git bisect start HEAD v1.0.0
git bisect run ./test.sh # exit 0 = good, 1-127 = bad

Reflog (Recovery Safety Net)

Tracks all ref movements for ~90 days, including deleted commits:

bash
git reflog # view all movements
git reflog show feature/branch # specific branch
# Recover from accidental reset
git reflog # find the lost commit hash
git reset --hard abc123 # restore to it
# Recover deleted branch
git branch recovered-branch abc123

Rebase vs Merge

Use RebaseUse Merge
Cleaning up local commits before pushIntegrating completed features into main
Keeping feature branch current with mainPreserving collaboration history
Creating linear history for reviewPublic branches used by others
bash
# Update feature branch with main (rebase)
git fetch origin
git rebase origin/main
# Handle conflicts, then: git rebase --continue
# Safe force push after rebase
git push --force-with-lease origin feature/branch

Recovery Commands

bash
# Abort in-progress operations
git rebase --abort
git merge --abort
git cherry-pick --abort
git bisect reset
# Undo last commit, keep changes
git reset --soft HEAD^
# Restore file from specific commit
git restore --source=abc123 path/to/file

Best Practices

  1. Always `--force-with-lease` over --force -- prevents overwriting others' work.
  2. Rebase only local commits -- never rebase commits already pushed and shared.
  3. Backup branch before risky operations -- git branch backup-branch before complex rebases.
  4. Atomic commits -- each commit is a single logical change.
  5. Test after history rewrite -- ensure rebase didn't break anything before force pushing.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/ain3sh/.agents/git-advanced/badge)](https://verified-skill.com/skills/ain3sh/.agents/git-advanced)

Something wrong with this skill or its page? Tell us.