From hyperskills
Guides complex Git operations: rebases, merge conflict resolution with decision trees, cherry-picking, branch management, undo commands, lockfile regeneration for pnpm/npm/Cargo/SOPS, and repository archaeology.
npx claudepluginhub hyperb1iss/hyperskills --plugin hyperskillsThis skill uses the workspace's default tool permissions.
Advanced git workflows and conflict resolution.
Mandates invoking relevant skills via tools before any response in coding sessions. Covers access, priorities, and adaptations for Claude Code, Copilot CLI, Gemini CLI.
Share bugs, ideas, or general feedback.
Advanced git workflows and conflict resolution.
| Situation | Strategy |
|---|---|
| Lock file conflict (pnpm-lock, Cargo.lock, etc.) | Never merge manually. Checkout theirs, regenerate. |
| SOPS encrypted file | Checkout theirs, run sops updatekeys, re-add. |
| Simple content conflict | Resolve manually, prefer smallest diff. |
| Large structural conflict | Consider --ours/--theirs + manual reapply of the smaller side. |
| Situation | Use |
|---|---|
| Feature branch behind main | git rebase origin/main |
| Shared branch (others have it checked out) | Never rebase. Merge only. |
| Cleaning up messy commits before PR | git rebase -i with squash/fixup |
| Already pushed and others pulled | Never rebase. Use git revert instead. |
| What happened | Fix |
|---|---|
| Wrong commit message (not pushed) | git commit --amend |
| Last commit was wrong (keep changes staged) | git reset --soft HEAD~1 |
| Last commit was wrong (keep changes unstaged) | git reset HEAD~1 |
| Already pushed bad commit | git revert <hash> (creates new commit) |
| Need to recover something lost | git reflog then git checkout HEAD@{N} |
Always regenerate, never manually merge:
# pnpm
git checkout --theirs pnpm-lock.yaml && pnpm install && git add pnpm-lock.yaml
# npm
git checkout --theirs package-lock.json && npm install && git add package-lock.json
# Cargo
git checkout --theirs Cargo.lock && cargo generate-lockfile && git add Cargo.lock
# SOPS encrypted files
git checkout --theirs secrets.yaml && sops updatekeys secrets.yaml && git add secrets.yaml
# Find when a string was added/removed
git log -S "search string" --oneline
# Blame specific lines
git blame -L 10,20 <file>
# Find commits touching a function
git log -L :functionName:file.js
# Binary search for a bug introduction
git bisect start && git bisect bad HEAD && git bisect good v1.0.0
--force-with-lease not --force (prevents overwriting others' work)git branch backup-$(date +%Y%m%d-%H%M%S)| Anti-Pattern | Fix |
|---|---|
| Manually merging generated lockfiles | Take one side, regenerate with the package tool |
| Rebasing a shared branch | Merge or create a new branch |
Using --force | Use --force-with-lease only when approved |
| Running recovery commands by habit | Inspect status, log, and reflog first |
| Staging unrelated work | git add <specific-files> |
git status or simple commits.