git-workflow

Guides git branch management, cherry-picking, rebasing, and safe push verification workflows.

Updated Aug 25, 2017
One-click install
npx skills add https://github.com/loki495/dotfiles --skill git-workflow-loki495
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: git-workflow
Source: https://github.com/loki495/dotfiles/tree/main/ai/skills/git-workflow
Command: npx skills add https://github.com/loki495/dotfiles --skill git-workflow-loki495

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Managing a multi-branch git workflow with local-only changes, production cherry-picks, and history reshaping is error-prone: accidental pushes of debug code, force-push mistakes, and unverified commit surgery can corrupt shared history. This Skill encodes a disciplined branch model and verification procedures to prevent those failures. ## Core Features & Use Cases - Branch Model Enforcement: Maintains a master/local/feature hierarchy where local-only work never reaches production branches. - Safe Cherry-Pick & Rebase Sequences: Standardizes cherry-picking commits to production and rebasing local and feature branches afterward. - Push Safety & History Verification: Requires explicit confirmation before pushes, scans unpushed commits for local-only work, and verifies rebases/amends with diff comparisons against ground-truth snapshots. - Use Case: Before pushing a feature to a protected main branch that rejects direct pushes with GH006, follow the documented flow of pushing to a throwaway branch, opening a PR, waiting for checks, and merging with rebase. ## Quick Start Use the git-workflow skill to cherry-pick my latest commit from local to master and verify the result before pushing.

Frequently Asked Questions about git-workflow

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

FAQPage Schema
How do I cherry-pick commits to a production branch safely?▼

Identify exact commits with git log --oneline, cherry-pick them onto master/main/stable resolving conflicts file-by-file, push only after explicit confirmation, then rebase your local branch onto the updated production branch to stay in sync.

How to reorganize unpushed git commits before pushing?▼

Review the unpushed log with git log --oneline origin/<branch>..HEAD, then freely rebase, amend, squash, split, or reorder commits. Verify the result with git diff against a snapshot commit to confirm content is unchanged.

Why does GitHub reject my push with GH006 protected branch error?▼

GH006 means a required status check has no green run for that exact commit SHA. Push to a throwaway branch, open a PR to trigger CI, wait for checks to pass, then merge with gh pr merge --rebase instead of force-pushing.

Can I rewrite commits that were already pushed to a shared remote?▼

No, pushed commits are off-limits without explicit confirmation because rewriting them requires a force-push. Confirm what is pushed with git branch -r --contains <sha> before assuming a commit can be reshaped.

What should I do when another session has uncommitted changes in the repo?▼

Only stage and commit your own changes, never discard foreign work. If history reshaping is needed, create a backup branch of the entire state first, do your surgery, then restore the other changes as uncommitted work.