git-advanced-workflows

Guide advanced Git workflows for history management and recovery.

Updated Sep 24, 2021
One-click install
npx skills add https://github.com/coolguy1771/dotfiles --skill git-advanced-workflows-coolguy1771
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-advanced-workflows
Source: https://github.com/coolguy1771/dotfiles/tree/main/chezmoi/private_dot_cursor/skills/git-advanced-workflows
Command: npx skills add https://github.com/coolguy1771/dotfiles --skill git-advanced-workflows-coolguy1771

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill empowers users to effectively manage complex Git histories, recover from mistakes, and collaborate more efficiently by mastering advanced Git commands and workflows.

Core Features & Use Cases

  • History Rewriting: Clean up commit messages, reorder, squash, or split commits using interactive rebase.
  • Selective Commit Application: Apply specific commits across branches using cherry-picking.
  • Bug Finding: Quickly identify the commit that introduced a bug with git bisect.
  • Parallel Development: Work on multiple branches simultaneously without context switching using git worktrees.
  • Recovery: Utilize git reflog to recover lost commits or branches.
  • Use Case: You've made several messy commits on a feature branch and need to clean them up before creating a Pull Request. This Skill guides you through using interactive rebase to squash, reword, and reorder your commits into a clean, logical history.

Quick Start

Use the git-advanced-workflows skill to clean up the last 5 commits on your current branch using interactive rebase.

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 messy commits before a pull request using interactive rebase?

Interactive rebase allows you to clean up commit history by squashing, rewording, reordering, or splitting commits. You can reorganize messy feature branch commits into a logical history before creating a pull request.

What is git bisect and how does it find bugs in commit history?

Git bisect is a binary search mechanism used to find the specific commit that introduced a bug. It systematically checks out commits between known good and bad states to quickly pinpoint the exact source of the error.

Can I recover lost commits or deleted branches after a hard reset?

You can recover lost commits or deleted branches using git reflog. Reflog tracks reference updates within your local repository, enabling you to locate and restore lost repository states after accidental errors.

How do I apply specific commits from one branch to another with cherry-pick?

Git cherry-pick applies specific commits from one branch onto another. This selective commit application isolates and transfers targeted changes without merging the entire branch history.

What is the best way to work on multiple branches without context switching?

Git worktrees enable parallel development by linking multiple working directories to a single repository. This allows you to work on multiple branches simultaneously without stashing or switching context.

Do I need command-line experience to use advanced Git workflows?

Advanced Git workflows require understanding of command-line operations and repository management principles. You must be comfortable executing terminal commands to rewrite history, bisect bugs, and recover lost states.