Agent skill
git-advanced-baphled-dotopencode
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/git-advanced-baphled-dotopencode
SKILL.md
Skill: git-advanced
What I do
I provide expertise in advanced Git operations to manage complex version control scenarios. I focus on history management, regression hunting, and clean collaboration workflows.
When to use me
- When cleaning up a complex feature branch before a pull request
- When hunting for a commit that introduced a bug using bisect
- When moving specific commits between branches using cherry-pick
- When recovering lost work using the reflog
Core principles
- History preservation: Use rebase to keep a linear history, but avoid changing pushed public history.
- Atomic search: Use bisect to find regression points quickly.
- Safety first: Use the reflog as a safety net for any operation that modifies HEAD.
- Fixup discipline: Use fixup commits to keep work-in-progress clean and easily squashable.
Patterns & examples
Interactive rebase:
Use git rebase -i HEAD~n to squash, reword, or reorder the last n commits. This is standard before merging any feature branch.
Git bisect:
- Start with
git bisect start. - Mark the current (broken) commit:
git bisect bad. - Mark a known good commit:
git bisect good <hash>. - Git will then check out a commit in the middle for testing. Continue marking
goodorbaduntil the culprit is found.
Fixup workflow:
- Make a small fix for a previous commit.
- Commit with
git commit --fixup=<hash>. - Later, use
git rebase -i --autosquash <base>to automatically merge those fixes.
Selective backporting:
Use git cherry-pick <hash> to apply a specific commit from another branch to your current one.
Anti-patterns to avoid
- ❌ Rewriting public history: Never rebase or squash commits that have already been pushed and shared with other developers.
- ❌ Force pushing blindly: Always use
--force-with-leasewhen pushing rebased branches to ensure you don't overwrite others' work. - ❌ Large rebases: Avoid rebasing branches with hundreds of commits. Rebase frequently to manage conflicts in small increments.
KB Reference
~/vaults/baphled/3. Resources/Knowledge Base/AI Development System/Skills/Git/Git Advanced.md
Related skills
git-master: For standard Git workflows and searchgit-worktree: For managing multiple branches simultaneouslyai-commit: For atomic commit discipline and attribution
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?