git-workflow

Guide safe Git workflows for branching, rebasing, and reflog recovery.

3|2|Updated Jun 9, 2026
One-click install
npx skills add https://github.com/JayRHa/AgentSkills --skill git-workflow-jayrha
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-workflow
Source: https://github.com/JayRHa/AgentSkills/tree/main/git-workflow
Command: npx skills add https://github.com/JayRHa/AgentSkills --skill git-workflow-jayrha

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Git workflows can easily destroy history or lose work when performing rewrites, merges, or force-pushes without guardrails. This skill provides a safety-first, disciplined approach to branching, atomic commits, interactive rebase, conflict resolution, and recovery using reflog.

Core Features & Use Cases

  • Branching strategies and naming conventions to keep history readable.
  • Atomic commits and managed history through interactive rebase and safe merge policies.
  • Conflict resolution workflow, merge vs rebase decision framework, and lost-work recovery using reflog.
  • Safe push practices and recovery guidance for mistaken resets or detached HEAD situations.

Quick Start

Walk me through the safe Git workflow to clean up a feature branch before opening a PR.

Frequently Asked Questions about git-workflow

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

FAQPage Schema
How do I clean up a feature branch before opening a PR?

To clean up a feature branch before a PR, use an interactive rebase to squash or edit atomic commits into a logical history. This approach ensures a readable and professional commit history before merging.

How do I recover lost work after a bad reset or detached HEAD in git?

Recover lost work from a bad reset or detached HEAD using the git reflog. The reflog tracks reference updates, allowing you to find the previous commit hash and safely restore the lost branch state.

When should I choose rebase instead of a standard merge?

Choose rebase instead of a standard merge to maintain a linear project history without unnecessary merge commits. A standard merge is safer for shared branches, while rebasing is better for local feature cleanup.

What is the best way to resolve merge conflicts without losing changes?

The best way to resolve merge conflicts without losing changes is to follow a structured conflict resolution workflow, manually inspecting conflicting files, and verifying atomic commits before finalizing the merge.

How can I safely force-push after rewriting commit history?

Safely force-push after rewriting history by ensuring no teammates are currently branching off the rewritten commits and using guarded force-push practices to prevent accidental remote history destruction.