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.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "git" with this command: npx skills add hyperb1iss/hyperskills/hyperb1iss-hyperskills-git

Git Operations

Advanced git workflows and conflict resolution.

Decision Trees

Conflict Resolution Strategy

SituationStrategy
Lock file conflict (pnpm-lock, Cargo.lock, etc.)Never merge manually. Checkout theirs, regenerate.
SOPS encrypted fileCheckout theirs, run sops updatekeys, re-add.
Simple content conflictResolve manually, prefer smallest diff.
Large structural conflictConsider --ours/--theirs + manual reapply of the smaller side.

Rebase vs Merge

SituationUse
Feature branch behind maingit rebase origin/main
Shared branch (others have it checked out)Never rebase. Merge only.
Cleaning up messy commits before PRgit rebase -i with squash/fixup
Already pushed and others pulledNever rebase. Use git revert instead.

Undo Operations

What happenedFix
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 commitgit revert <hash> (creates new commit)
Need to recover something lostgit reflog then git checkout HEAD@{N}

Lock File Conflicts

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

Archaeology

# 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

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

tui-design

No summary provided by upstream source.

Repository SourceNeeds Review
General

orchestrate

No summary provided by upstream source.

Repository SourceNeeds Review
General

brainstorm

No summary provided by upstream source.

Repository SourceNeeds Review