git-advanced-workflows

Rebase, cherry-pick, bisect, manage worktrees, and inspect reflog in Git.

6|Updated Mar 24, 2023
One-click install
npx skills add https://github.com/GaoZimeng0425/nemo-cli --skill git-advanced-workflows-gaozimeng0425
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-advanced-workflows
Source: https://github.com/GaoZimeng0425/nemo-cli/tree/main/.claude/skills/git-advanced-workflows
Command: npx skills add https://github.com/GaoZimeng0425/nemo-cli --skill git-advanced-workflows-gaozimeng0425

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps you master advanced Git workflows, ensuring clean history and the ability to recover from any situation, making it ideal for managing complex Git histories and collaborating on feature branches.

Core Features & Use Cases

  • Interactive Rebase: Clean up commit history and create linear histories for easier review.
  • Cherry-Picking: Apply specific commits across branches without merging entire branches.
  • Git Bisect: Find commits that introduced bugs using binary search.
  • Worktrees: Work on multiple branches simultaneously without stashing or switching.
  • Reflog: Track all ref movements and recover from Git mistakes or lost commits.
  • Use Case: When you need to clean up a feature branch before merging, apply a hotfix to multiple releases, find the introduction of a bug, or recover from a mistake.

Quick Start

Use the git-advanced-workflows skill to clean up your feature branch by rebasing on the main branch.

Frequently Asked Questions about git-advanced-workflows

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I clean up my feature branch history before merging?

To clean up feature branch history, use interactive rebase to squash or reorder commits, creating a linear history. This workflow ensures your branch remains easy to review before integration into the main branch.

How does git bisect help find commits that introduced bugs?

Git bisect finds commits that introduced bugs by performing a binary search through your repository history. It systematically checks out commits, allowing you to test and mark them as good or bad to isolate the exact source.

What is the best way to apply a hotfix to multiple release branches?

The best way to apply a hotfix to multiple release branches is cherry-picking. Cherry-picking applies specific commits across branches without merging entire branches, ensuring only the necessary changes are transferred.

How do I recover lost commits after a hard reset or bad rebase?

To recover lost commits after a hard reset or bad rebase, use git reflog. Reflog tracks all ref movements in your repository, allowing you to identify and restore the exact commit hash from before the mistake.

Can I work on multiple branches simultaneously without stashing changes?

You can work on multiple branches simultaneously without stashing changes by using git worktrees. Worktrees allow you to check out multiple branches into separate directories, enabling parallel development on different tasks.

When do I need to rebase instead of merging in git?

You need to rebase instead of merging when you want to maintain a linear project history. Rebasing replays your local commits on top of the main branch, avoiding merge commits and simplifying the history review process.