git-workflow
Skill33 starsChanged 22 days agoMITView on GitHub
Use for branching, committing, history repair, and release hygiene. Covers atomic commits, rebase versus merge, bisect, reflog recovery, and undoing mistakes safely. Trigger on "undo my last commit", "i messed up a rebase", "squash these commits", "find which commit broke this". Do not use for pipeline and deploy automation — see the ci-cd skill.
- Deletes or force-pushes
- Commits and pushes
We split this skill into the rules it gives an agent
5 rules. 0 are common, 4 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 163 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 14
Keep history readable and recoverable.
- Distinctive: line 40
Commit messages that explain why, not what.
- Very specific: line 53
Never git push --force to a shared branch.
- Distinctive: line 56
Do not commit generated files, secrets, or large binaries.
- Distinctive: line 97
If a secret is committed, rotating it is mandatory and rewriting history is optional.
“Common” is measured: kept by at least 6 in 10 of the 163 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Git Workflow
Purpose
Keep history readable and recoverable. A good history is a debugging tool: it lets you bisect, revert, and explain. A bad one is a wall of "fix", "fix again", "wip".
When to Use
- Structuring commits before opening a pull request.
- Recovering from a bad rebase, reset, or force-push.
- Bisecting to find the commit that introduced a regression.
- Cleaning up a branch's history.
- Deciding a team branching strategy.
Capabilities
- Atomic commit construction, including interactive staging.
- History rewriting: interactive rebase, squash, fixup, autosquash.
- Recovery: reflog,
ORIG_HEAD,git restore, cherry-pick. - Bisection, including automated bisection with a test script.
- Conflict resolution and
rerere.
Inputs
- The repository state and the branch's relationship to its base.
- Whether the branch has been pushed and whether others have based work on it.
Outputs
- A branch whose commits each build, pass tests, and do one thing.
- Commit messages that explain why, not what.
- A rebase or merge that preserves the ability to revert cleanly.
Workflow
- Commit atomically — One logical change per commit. Use
git add -pto split a messy working tree. - Write the message for the future — Subject in the imperative under 72 characters; body explaining why the change was needed.
- Clean before review —
git rebase -ito squash fixups and reorder. Reviewers should read the story, not the process. - Rebase private branches, merge shared ones — Rewriting history that others have pulled is how you lose their work.
- Recover with reflog — Almost nothing is truly lost.
git reflogshows every position HEAD has held.
Best Practices
- Never
git push --forceto a shared branch. Use--force-with-lease, which refuses if someone else has pushed. - A commit that does not build is a commit that breaks bisect. Keep every commit green.
git commit --fixup <sha>plusgit rebase -i --autosquashmakes review-response commits disappear cleanly.- Do not commit generated files, secrets, or large binaries. Removing them later requires rewriting history for everyone.
git bisect run ./test.shfinds the offending commit automatically. It is the fastest regression hunt available.- Enable
rerere— Git will remember how you resolved a conflict and reapply it next time.
Examples
Automated bisection:
git bisect start
git bisect bad HEAD # current commit is broken
git bisect good v2.14.0 # this release was fine
# Any script exiting 0 for good, non-zero for bad.
git bisect run pytest tests/test_checkout.py::test_total
# Git prints the first bad commit, then:
git bisect resetRecovering a branch destroyed by a bad reset:
git reflog # find the sha from before the reset
# 8a3f1c2 HEAD@{3}: commit: add proration handling
git reset --hard 8a3f1c2 # branch is backSplitting a messy working tree into reviewable commits:
git add -p # stage hunks belonging to the first change
git commit -m "Extract proration calculator"
git add -p # stage the next logical change
git commit -m "Fix double-charge on mid-cycle upgrade"Notes
- The reflog is local and expires (90 days by default). It will not save you from a force-push that only ever existed on someone else's machine.
- Merge commits make
git log --onelinenoisy but preserve the true topology. On a team that reviews by PR, squash-merging to main and keeping the branch history in the PR is a reasonable middle ground. - If a secret is committed, rotating it is mandatory and rewriting history is optional. Assume it is compromised the moment it is pushed.
Other versions190 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 190
- langfuse/langfuse★ 37ksame name
- modelcontextprotocol/typescript-sdk★ 14ksame name
- JetBrains/ideavim★ 10ksame name
- jokob-sk/NetAlertX★ 7.3ksame name
- netalertx/NetAlertX★ 7.3ksame name
- Galaxy-Dawn/claude-scholar★ 5.9ksame name
- github/gh-aw★ 5.5ksame name
- modelcontextprotocol/csharp-sdk★ 4.6ksame name
- antonbabenko/pre-commit-terraform★ 3.8ksame name
- microsoft/Generative-AI-for-beginners-dotnet★ 3.2ksame name
180 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
Used alongsideProjects with it also use squad-commands, architectural-proposals and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
MicrosoftSkillsquad-commands
Categorized catalog of common Squad operations. Coordinator reads this file and presents it as an interactive menu when the user asks for available commands or help.
Also in 5 projects that use this
MicrosoftSkillarchitectural-proposals
How to write comprehensive architectural proposals that drive alignment before code is written
Also in 4 projects that use this
frostneySkillnative-nostalgia-stack
Applies the user's FreePascal toolchain and its build, formatting, hook, and test contracts while leaving project-specific mechanics local. Use when scaffolding or working in a FreePascal project that follows this toolchain.
Also in 3 projects that use this
- +9 more from microsoft
In this repository137 other files it gives its agents.
- agent-instructionsSkill
- agent-memorySkill
- hooksSkill
- plugin-developmentSkill
- skill-authoringSkill
- skill-reviewSkill
- slash-commandsSkill
- subagentsSkill
- agent-designSkill
- context-engineeringSkill
- fine-tuningSkill
- llm-cost-optimizationSkill
- llm-evaluationSkill
- llm-integrationSkill
- mcp-serverSkill
- ml-pipelineSkill
- model-selectionSkill
- prompt-engineeringSkill
- ragSkill
- structured-outputSkill
- api-designSkill
- background-jobsSkill
- cachingSkill
- djangoSkill
- event-driven-architectureSkill
- fastapiSkill
- graphqlSkill
- microservicesSkill
- nestjsSkill
- realtime-websocketsSkill
- spring-bootSkill
- competitive-analysisSkill
- lead-researchSkill
- product-analysisSkill
- resumeSkill
- user-researchSkill
- database-performanceSkill
- data-modelingSkill
- data-qualitySkill
- pandasSkill
- postgresSkill
- sparkSkill
- brand-guidelinesSkill
- generative-artSkill
- themingSkill
- ui-reviewSkill
- visual-designSkill
- architecture-decisionsSkill
- bug-fix-protocolSkill
- cli-developmentSkill
- code-reviewSkill
- debuggingSkill
- design-patternsSkill
- domain-modelingSkill
- legacy-modernizationSkill
- refactoringSkill
- repository-explorationSkill
- simple-designSkill
- system-designSkill
- aws-cdkSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

