git-workflow
Skill1 starsChanged 6 months agoMITView on GitHub
Work git like a professional - branching discipline, rebase vs merge, history hygiene, interactive rebase, bisect, and recovering from mistakes with reflog. Use when the user asks about branching strategy, fixing a messy history, undoing a git mistake, resolving conflicts, splitting commits, or any non-trivial git operation.
- Deletes or force-pushes
- Commits and pushes
118 other projects use a version of this.
Adopted by
Most recently taken up by
- Lukk17/agent-standardstheir own version, first seen Oct 5, 2026
- JameMy0001/antigravity-skills-hubtheir own version, first seen Oct 2, 2026
- NinjaSln-labs/agent-skillstheir own version, first seen Oct 2, 2026
- 1pedroosilva/databricks-genie-skillstheir own version, first seen Oct 2, 2026
- vospr/context-engineering-templatetheir own version, first seen Oct 1, 2026
- fusebase-dev/fusebase-flowtheir own version, first seen Oct 1, 2026
Used with
Projects with it also use squad-commands, typescript-patterns and 9 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 3 projects that use this
cohen-lielSkilltypescript-patterns
TypeScript best practices and patterns. Use when writing TypeScript code, defining types, working with generics, or converting JavaScript to TypeScript.
Also in 4 projects that use this
martinholovskySkillllm-integration
Expert skill for integrating local Large Language Models using llama.cpp and Ollama. Covers secure model loading, inference optimization, prompt handling, and protection against LLM-specific vulnerabilities including prompt injection, model theft, and denial of service attacks.
Also in 4 projects that use this
YepAPISkillbackground-jobs
Queue workers with BullMQ/Inngest/Trigger.dev, job retries, dead letter queues, concurrency.
Also in 3 projects that use this
Vimalk0703Skilldependency-management
Vet packages before adoption, audit for vulnerabilities, pin versions, and prevent dependency bloat.
Also in 3 projects that use this
pluginagentmarketplaceSkillmicroservices
Microservices architecture patterns and best practices. Service decomposition, inter-service communication, and distributed data management.
Also in 3 projects that use this
Other versions118 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 118
- JetBrains/ideavim★ 10ksame name
- Galaxy-Dawn/claude-scholar★ 5.7ksame name
- github/gh-aw★ 5.3ksame name
- microsoft/Generative-AI-for-beginners-dotnet★ 3.1ksame name
- microsoft/waza★ 1.4ksame name
- laolaoshiren/claude-code-skills-zh★ 876same name
- Mindrally/skills★ 266same name
- Azure/fleet★ 226same name
- povvo/claudikins-kernel★ 128same name
- extra-org/extra★ 113same name
108 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.
In this repository50 other files it gives its agents.
- accessibility-reviewSkill
- adr-authorSkill
- api-designSkill
- architecture-reviewSkill
- caching-strategySkill
- changelogSkill
- ci-cd-pipelineSkill
- codebase-explorationSkill
- code-reviewSkill
- code-style-guideSkill
- context-engineeringSkill
- conventional-commitsSkill
- cost-optimizationSkill
- database-migrationSkill
- data-privacy-reviewSkill
- debuggingSkill
- dependency-updateSkill
- deprecation-migrationSkill
- error-handlingSkill
- feature-flag-rolloutSkill
- filament-resource-designSkill
- flux-ui-patternsSkill
- i18n-reviewSkill
- idea-refineSkill
- incident-responseSkill
- incremental-implementationSkill
- inertia-patternsSkill
- laravel-ai-featuresSkill
- laravel-eloquent-performanceSkill
- laravel-queue-designSkill
- laravel-testingSkill
- livewire-component-designSkill
- llm-feature-designSkill
- observabilitySkill
- onboarding-docSkill
- performance-budgetSkill
- pr-descriptionSkill
- primevue-patternsSkill
- refactoringSkill
- release-checklistSkill
- resilience-patternsSkill
- runbook-authorSkill
- security-auditSkill
- spec-writingSkill
- task-breakdownSkill
- tech-debt-triageSkill
- test-writingSkill
- threat-modelingSkill
- using-elyra-skillsSkill
- vue-component-patternsSkill
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 101 edited versions we read keep these.
3
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
- Distinctive: line 35
Keep current with main via git rebase main (own branch) — resolves conflicts while they're small
- Distinctive: line 64
Read both sides before choosing.
- Very specific: line 65
After resolving: build + run tests *before* --continue
- Distinctive: line 70
When advising on or performing git surgery, report:
“Common” is measured: kept by at least 6 in 10 of the 101 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
History is a tool, not a diary. Optimize it for the future reader — the reviewer today and the person running git bisect in two years.
When to use
- "How should we branch for this?" / "rebase or merge?"
- "I committed to the wrong branch / pushed a secret / lost my changes"
- Cleaning up a PR's history before review
- Conflicts, cherry-picks, splitting or reordering commits
Principles
- Small branches, short lives. A branch older than a few days is a merge conflict farm. Integrate often.
- Each commit compiles and passes tests. That's what makes
git bisectwork and reverts surgical. - Rewrite local history freely, shared history never. Rebase your own unpushed work; once others build on it, it's immutable.
- Almost nothing is lost. Committed work is recoverable via
reflogfor ~90 days. Don't panic; don'trm -rfand re-clone.
Branching discipline
- Branch from up-to-date main; name by intent:
feat/...,fix/...,chore/... - One branch = one reviewable concern. Two features = two branches
- Keep current with main via
git rebase main(own branch) — resolves conflicts while they're small - Rebase vs merge rule of thumb: rebase your private branch onto main; merge (or squash-merge) the branch into main per the team's convention. Never rebase a branch others have pulled
History hygiene (before review)
git rebase -i main # squash fixups, reorder, reword
git commit --fixup <sha> # mark a fix for an earlier commit…
git rebase -i --autosquash main # …then fold it in automatically
git add -p # stage hunks selectively → atomic commitsTarget: each commit is one logical change with a message explaining why (see conventional-commits).
Recovery cookbook
| Situation | Fix |
| Committed on wrong branch | git checkout right-branch && git cherry-pick <sha>, then remove from wrong branch |
| Undo last commit, keep changes | git reset --soft HEAD~1 |
| Undo a pushed commit | git revert <sha> — never reset shared history |
| "I lost my work" | git reflog → find the sha → git checkout -b rescue <sha> |
| Messed-up rebase/merge in progress | git rebase --abort / git merge --abort |
| Secret pushed | Rotate the secret first (history rewrite alone never un-leaks it), then scrub with git filter-repo |
| Find the commit that broke X | git bisect start && git bisect bad && git bisect good <sha> (automate: git bisect run <test-cmd>) |
Conflict resolution
- Resolve conflicts per commit during rebase — smaller, with context
- Read both sides before choosing; "take mine" without reading is how regressions ship
- After resolving: build + run tests before
--continue - Recurring conflicts in lockfiles/generated files → regenerate instead of hand-merging
Output format
When advising on or performing git surgery, report:
## Git: <operation>
**Situation:** what state the repo was in.
**Plan:** commands, in order, with one-line why each.
**Safety:** what's backed up (branch/sha) before destructive steps.
**Result:** end state + how to verify (`git log --oneline -5`, tests).Anti-patterns
- ❌
git push --forceto a shared branch (--force-with-leaseon your own, after rebase, is fine) - ❌ Commits named "wip", "fix", "fix2", "final" reaching main
- ❌ Long-lived feature branches integrating monthly
- ❌ Resolving a rebase conflict by mass-accepting one side
- ❌ Re-cloning the repo because the working tree "feels broken" — diagnose with
status/reflogfirst - ❌ Rewriting pushed history to hide a leaked secret instead of rotating it
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.

