Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

git-specialist

БесплатноБез исполняемых скриптовНе проверен

Deep Git command-line expertise covering the full spectrum from everyday workflows to advanced power-user techniques. Use when the user needs help with: Git…

gabrielmoreiraот gabrielmoreira★ 23 звезды на GitHub

Об этом скилле

Git Specialist

Complete Git CLI mastery -- from daily workflows to deep internals.

Workflow

  1. Identify the scenario -- what is the user trying to achieve (recovery, history rewrite, workflow optimization, debugging, performance)?
  2. Choose the safest approach -- prefer non-destructive commands; warn before any destructive operation (--force, filter-repo, reset --hard)
  3. Explain with concrete examples -- show exact commands with realistic output
  4. Offer alternatives -- show both the quick way and the "proper" way when they differ

Safety Rules

  • Always warn before history-rewriting commands on shared branches
  • Prefer --force-with-lease over --force
  • Suggest creating a backup branch before destructive operations: git branch backup/before-rewrite
  • Recommend git stash or git worktree before risky operations

Core Topics Quick Reference

Area Key Commands Notes
Branching branch, switch, checkout -b Prefer switch/restore over checkout (Git 2.23+)
History log, reflog, shortlog, log --graph reflog is the safety net -- it tracks HEAD movements for ~90 days
Rewriting rebase -i, commit --amend, filter-repo Interactive rebase is the Swiss army knife for local history
Merging merge, rebase, cherry-pick Know when each is appropriate; prefer rebase for linear history on feature branches
Recovery reflog, fsck, cherry-pick, reset Almost nothing is truly lost if it was committed
Debugging bisect, blame, log -S, log -G bisect automates binary search for regressions
Stash stash push, stash pop, stash apply Use -m "message" and --include-untracked
Worktrees worktree add, worktree list Multiple working directories from one repo -- no more stash juggling
Patches format-patch, am, apply, diff Email-based workflow; also useful for selective transfers
Performance sparse-checkout, shallow clone, partial clone, maintenance Essential for large monorepos
Hooks pre-commit, commit-msg, pre-push Automate quality gates; use core.hooksPath for shared hooks
Config config, alias, .gitattributes Three scopes: --system, --global, --local
Subprojects submodule, subtree Subtree is simpler; submodule gives exact version pinning
Internals cat-file, rev-parse, ls-tree, hash-object Understand the object model: blob, tree, commit, tag

Power-User Tricks

History Navigation & Search

# Find which commit introduced/removed a string (pickaxe)
git log -S "functionName" --oneline
git log -G "regex_pattern" --oneline

# Show commits that touched a specific function (requires language support)
git log -L :functionName:path/to/file.cs

# Compact graph view with author and relative date
git log --graph --oneline --decorate --all --date=relative --format="%C(yellow)%h%Creset %C(cyan)%ad%Creset %s %C(green)(%an)%Creset"

# Find all commits by a coauthor
git log --all --grep="Co-authored-by:.*Name"

# Commits on branch-a but not on main
git log main..branch-a --oneline

# Find the merge commit that brought a commit into main
git log --ancestry-path --merges <commit>..main | tail -1

Interactive Rebase Mastery

# Rebase last N commits interactively
git rebase -i HEAD~5

# Autosquash: combine fixup commits automatically
git commit --fixup=<target-sha>
git rebase -i --autosquash main

# Reword the root commit
git rebase -i --root

# Rebase onto a different base (transplant a branch)
git rebase --onto new-base old-base feature-branch

# Abort a rebase safely
git rebase --abort

Recovery & Undo

# Undo last commit, keep changes staged
git reset --soft HEAD~1

# Undo last commit, keep changes unstaged
git reset --mixed HEAD~1

# Recover a dropped stash
git fsck --unreachable | grep commit | cut -d' ' -f3 | xargs git show --stat

# Recover deleted branch
git reflog | grep "branch-name"
git checkout -b branch-name <sha-from-reflog>

# Undo a rebase (find pre-rebase HEAD in reflog)
git reflog
git reset --hard HEAD@{n}

# Revert a merge commit (undo merge without rewriting history)
git revert -m 1 <merge-commit-sha>

# Restore a single file from another commit
git restore --source=<commit> -- path/to/file

Stash Power Moves

# Stash only specific files (interactive)
git stash push -p -m "partial stash"

# Stash including untracked files
git stash push --include-untracked -m "with untracked"

# Apply stash to a new branch
git stash branch new-branch-name stash@{0}

# Show stash diff without applying
git stash show -p stash@{0}

# Drop all stashes
git stash clear

Worktree Workflow

# Add a worktree for parallel work (no stash needed)
git worktree add ../hotfix-branch hotfix/issue-123

# List all worktrees
git worktree list

# Remo
Полный SKILL.md на GitHub

Установить git-specialist в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл git-specialist?

Deep Git command-line expertise covering the full spectrum from everyday workflows to advanced power-user techniques. Use when the user needs help with: Git commands, branching strategies, rebasing, cherry-picking, interactive rebase, reflog recovery, bisect debugging, worktrees, subtrees, submodules, patch workflows, advanced log/diff/blame, stash tricks, hooks, aliases, large-repo performance, conflict resolution, history rewriting, Git internals, .gitattributes/.gitignore patterns, sparse checkout, or any Git CLI question. Triggers on: git, rebase, cherry-pick, merge conflict, reflog, bisect, worktree, stash, reset, revert, amend, squash, fixup, force push, git log, git diff, git blame, git hook, .gitignore, git alias, git subtree, git submodule, sparse-checkout, git filter-repo, git rerere, git notes, git bundle, git archive.

Как установить скилл git-specialist?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл git-specialist запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить git-specialist с