git-workflow

Solid

Guides safe, professional Git usage — branching strategies, atomic clean commits, conventional commit messages, interactive rebase (squash/fixup/reword/reorder), merge vs rebase decisions, conflict resolution, and recovery of lost work via reflog. Use this skill when the user asks to create or clean up a branch, write or amend commits, squash or reorder history, rebase onto main, resolve merge conflicts, undo a bad commit/merge/reset, recover deleted commits or branches, find lost work, fix a detached HEAD, force-push safely, or generally "clean up my git history" before opening a PR.

AI & Automation 3 stars 2 forks Updated today MIT

Install

View on GitHub

Quality Score: 79/100

Stars 20%
20
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Git Workflow ## Overview This skill provides a disciplined, safe workflow for everyday Git: branching, crafting clean atomic commits, rewriting history with interactive rebase, resolving conflicts, and recovering from mistakes using the reflog. The guiding principle is **safety first** — never destroy work you cannot recover, always know your escape hatch before running a history-rewriting command. Keywords: git, branch, commit, rebase, interactive rebase, squash, fixup, reword, cherry-pick, merge, conflict, conflict resolution, reflog, recover lost commits, undo, reset, revert, detached HEAD, force-push, stash, clean history, conventional commits, PR prep. **Golden rules** 1. Never rewrite history that others have already pulled (shared branches like `main`/`develop`). Rewrite only your own unmerged feature branches. 2. Before any `rebase`, `reset --hard`, or force-push, note the current commit: `git rev-parse HEAD` or just trust the reflog — it remembers. 3. Prefer `git push --force-with-lease` over `--force`. It refuses to clobber commits you haven't seen. 4. Commit early, commit often locally; clean up into atomic commits before sharing. 5. If something looks lost, it almost certainly isn't — go to `git reflog` (see references/reflog-recovery.md). ## Workflow ### 1. Orient before acting Always understand current state first: ``` git status # working tree + branch git log --oneline -10 # recent history git branch -vv # branches + tracking ``` ###...

Details

Author
JayRHa
Repository
JayRHa/AgentSkills
Created
1 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category