git
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.
What this skill does
# Git Operations
Advanced git workflows and conflict resolution.
## Decision Trees
### Conflict Resolution Strategy
| 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. |
### Rebase vs Merge
| 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. |
### Undo Operations
| 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}` |
## Lock File Conflicts
**Always regenerate, never manually merge:**
```bash
# 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
```
## Archaeology
```bash
# 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
```
## Safety Rules
1. **Never rebase shared branches**
2. **`--force-with-lease`** not `--force` (prevents overwriting others' work)
3. **Regenerate lock files** -- never merge them
4. **Backup branch before destructive ops:** `git branch backup-$(date +%Y%m%d-%H%M%S)`
5. **Never commit large binaries** -- use Git LFS
## Anti-Patterns
| 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>` |
## What This Skill is NOT
- Not for routine `git status` or simple commits.
- Not permission to rewrite shared history.
- Not a replacement for understanding the diff before committing.
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.