git-advanced-workflows

Git Advanced Workflows

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-advanced-workflows" with this command: npx skills add mileycy516-stack/skills/mileycy516-stack-skills-git-advanced-workflows

Git Advanced Workflows

Master advanced Git techniques to maintain clean history, collaborate effectively, and recover from any situation with confidence.

When to Use This Skill

  • Cleaning up commit history before merging (rebase)

  • Applying specific commits across branches (cherry-pick)

  • Finding commits that introduced bugs (bisect)

  • Working on multiple features simultaneously (worktrees)

  • Recovering from Git mistakes or lost commits (reflog)

  • Synchronizing diverged branches

Workflow

  • Context: Are you cleaning history, recovering lost work, or isolating a bug?

  • Safety: Always create a backup branch before destructive operations (git branch backup-before-rebase ).

  • Execute: Use the specific command (rebase -i, bisect, reflog).

  • Verify: Check log/tests to ensure integrity.

  • Push: If history changed, use --force-with-lease .

Instructions

  1. Interactive Rebase (The History Editor)

Use to squash typos, reword messages, or reorder commits.

git rebase -i HEAD~5

Commands: pick, reword, edit, squash, fixup, drop

  • Autosquash: git commit --fixup HEAD -> git rebase -i --autosquash main .
  1. Cherry-Picking (The Sniper)

Apply specific commits to another branch without merging.

git cherry-pick abc1234 git cherry-pick abc1234..def5678 # Range git cherry-pick -n abc1234 # Stage only (no commit)

  1. Git Bisect (The Bug Hunter)

Binary search to find the exact commit that broke something.

git bisect start git bisect bad # Current is broken git bisect good v1.0.0 # v1.0.0 was working

Git checks out middle commit... you test...

git bisect good # or bad

Repeat until found

git bisect reset

  1. Worktrees (The Multitasker)

Check out multiple branches in parallel folders. No more stash/switch ping-pong.

git worktree add ../feature-folder feature/new-stuff

Work there...

git worktree remove ../feature-folder

  1. Reflog (The Time Machine)

Recover "lost" commits after a hard reset or delete.

git reflog

Find the hash BEFORE you messed up (e.g., abc1234)

git reset --hard abc1234

Or restore a deleted branch

git branch recovered-branch abc1234

Resources

  • Rebase Guide

  • Conflict Resolution

  • Recovery & Safety

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.

Automation

playwright browser automation

No summary provided by upstream source.

Repository SourceNeeds Review
General

trading-psychology-coach

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

frontend-developer

No summary provided by upstream source.

Repository SourceNeeds Review