git-workflow

Stage, commit, and push Git changes with diff review and rebase recovery.

3|Updated Apr 21, 2024
One-click install
npx skills add https://github.com/gabrielfruet/.dotfiles --skill git-workflow-gabrielfruet
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-workflow
Source: https://github.com/gabrielfruet/.dotfiles/tree/main/pi/agent/skills/git-workflow
Command: npx skills add https://github.com/gabrielfruet/.dotfiles --skill git-workflow-gabrielfruet

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the risk of inconsistent, error-prone Git commit and push workflows that lead to messy commit history, failed pushes, or lost changes after completing code modifications.

Core Features & Use Cases

  • Enforced Git Best Practices: Automatically follows safe Git conventions including mandatory diff review before committing, separation of logical changes into distinct commits, and prohibition of dangerous commands like git add -A.
  • Common Error Recovery: Handles frequent Git issues including push rejections requiring rebase, hanging rebase operations in non-interactive shells, commit hooks that rewrite files, and untracked file conflicts when switching branches.
  • Use Case: After finishing a feature implementation or bug fix, use this Skill to safely stage, commit, and push your work without introducing messy commit history or running into avoidable Git errors.

Quick Start

Use the git-workflow skill to stage, commit, and push your verified code changes following Git best practices after you finish a code modification task.

Frequently Asked Questions about git-workflow

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

FAQPage Schema
How do I enforce a safe git commit and push workflow after finishing code changes?

A safe git commit and push workflow requires mandatory diff review before staging, separating logical changes into distinct commits, and avoiding broad commands like git add -A to maintain a clean history.

Why does my git push fail with rejection errors and how do I fix it?

Git push rejections occur when remote changes conflict with local commits. Fix push rejections by applying a rebase to synchronize your local branch with the remote repository before pushing again.

What is the best way to separate logical changes into distinct git commits?

The best way to separate logical changes into distinct git commits is to explicitly stage targeted files or hunks after reviewing the diff, ensuring each commit represents a single coherent modification.

How do I recover from a hanging git rebase in a non-interactive shell?

Recover from a hanging git rebase in a non-interactive shell by detecting the paused state and applying automated resolution commands to bypass the interactive prompt and complete the rebase.

How do I handle untracked file conflicts when switching git branches?

Handle untracked file conflicts when switching git branches by detecting the overlapping files and safely removing or stashing the untracked local modifications before executing the checkout.

What to do when pre-commit hooks rewrite files during a git commit?

When pre-commit hooks rewrite files during a git commit, detect the modified files, restage the hook's automatic formatting changes, and re-attempt the commit to ensure the staged content matches repository rules.