Loading...
Loading...
Use this skill for complex git operations including rebases, merge conflict resolution, cherry-picking, branch management, or repository archaeology. Activates on mentions of git rebase, merge conflict, cherry-pick, git history, branch cleanup, git bisect, worktree, force push, or complex git operations.
npx skill4agent add hyperb1iss/hyperskills git| Situation | Strategy |
|---|---|
| Lock file conflict (pnpm-lock, Cargo.lock, etc.) | Never merge manually. Checkout theirs, regenerate. |
| SOPS encrypted file | Checkout theirs, run |
| Simple content conflict | Resolve manually, prefer smallest diff. |
| Large structural conflict | Consider |
| Situation | Use |
|---|---|
| Feature branch behind main | |
| Shared branch (others have it checked out) | Never rebase. Merge only. |
| Cleaning up messy commits before PR | |
| Already pushed and others pulled | Never rebase. Use |
| What happened | Fix |
|---|---|
| Wrong commit message (not pushed) | |
| Last commit was wrong (keep changes staged) | |
| Last commit was wrong (keep changes unstaged) | |
| Already pushed bad commit | |
| Need to recover something lost | |
# 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--forcegit branch backup-$(date +%Y%m%d-%H%M%S)