git-operations
Skill16 starsChanged 4 days agoMITView on GitHub
Git command patterns, branching strategy, and safety protocols. TRIGGER when: managing branches, resolving merge conflicts, or running commit/merge/push operations. SKIP: worktree lifecycle and isolation recovery (use worktree-management); CI automation (use github-actions-template).
- Commits and pushes
5 other projects use a version of this.
Adopted by
Most recently taken up by
- GoogleCloudPlatform/sciontheir own version, first seen Oct 13, 2026
- m16khb-org/issueopstheir own version, first seen Sep 24, 2026
- snui1s/losna-clitheir own version, first seen Aug 31, 2026
- poorvith-mp/skills-developertheir own version, first seen Aug 19, 2026
- arnabdeypolimi/claude_code_setuptheir own version, first seen May 5, 2026
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- GoogleCloudPlatform/scion★ 2.1ksame name
- m16khb-org/issueops★ 6same name
- arnabdeypolimi/claude_code_setup★ 4same name
- snui1s/losna-cli★ 1same name
- poorvith-mp/skills-developer★ 0same name
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 repository39 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- agent-commsSkill
- agent-memorySkill
- api-designSkill
- context-engineeringSkill
- database-optimizationSkill
- distillSkill
- docker-templatesSkill
- error-handlingSkill
- frontend-designSkill
- github-actions-templateSkill
- logging-standardsSkill
- mcp-toolsSkill
- monitoring-observabilitySkill
- mui-stylingSkill
- necessity-firstSkill
- pattern-recognitionSkill
- planning-methodologySkill
- python-patternsSkill
- quality-validationSkill
- react-patternsSkill
- research-methodologySkill
- reverse-engineer-anythingSkill
- security-review-checklistsSkill
- semantic-memory-mcpSkill
- skill-authoringSkill
- sofa-searchSkill
- spec-designSkill
- spec-developSkill
- spec-researchSkill
- spec-reviewSkill
- spec-workflowSkill
- state-managementSkill
- systematic-debuggingSkill
- testing-strategySkill
- ui-ux-pro-maxSkill
- verification-before-completionSkill
- watch-patternsSkill
- worktree-managementSkill
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 6 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
6
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
- Very specific: line 76
NEVER use --force or --force-with-lease without explicit user confirmation
- Distinctive: line 77
Always verify unpushed commits BEFORE push
- Distinctive: line 78
Always verify push success AFTER push
- Distinctive: line 79
If push fails due to divergence, report to user -- do NOT auto-rebase
- Distinctive: line 83
After work is complete on a branch, execute one of these four actions based on context.
- Distinctive: line 103
Never delete remote branches here.
- Distinctive: line 104
Put the result in the final report (Worktree Cleanup table).
“Common” is measured: kept by at least 6 in 10 of the 4 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 Operations Skill
Purpose
Core git command patterns, branching strategies, and safety protocols for a project.
Current branch: !git branch --show-current 2>/dev/null || true
Branching Convention
| Branch Pattern | Purpose |
main | Production branch, always stable |
scaffolding/{task_id[:12]} | Worktree task branches (auto-created) |
backup/{task_id[:12]} | Safety backup before destructive ops |
Safe Operation Patterns
Before Any Destructive Operation
git status
git stash list
git log --oneline -5
git branch backup/$(date +%s) HEADMerge Strategy
git merge --no-commit --no-ff branch_name
git diff --cached --stat
git merge --continue # or --abortConflict Resolution
git diff --name-only --diff-filter=U
git checkout --ours path/to/file # keep ours
git checkout --theirs path/to/file # keep theirsCherry-Pick
git cherry-pick --no-commit <commit>
git diff --cached --stat
git cherry-pick --continueCommon Error Patterns
| Error | Fix |
fatal: not a git repository | Verify path, check .git exists |
CONFLICT (content) | Use conflict resolution protocol |
cannot lock ref | Wait and retry, check stale locks |
worktree is not clean | Stage+commit or stash |
Push Operations
Standard Push (after workflow)
# 1. Verify unpushed commits exist
git log --oneline origin/main..HEAD
# 2. Push to remote
git push origin main
# 3. Verify push succeeded
git log --oneline origin/main..HEAD # should be emptyPush Safety Rules
- NEVER use
--forceor--force-with-leasewithout explicit user confirmation - Always verify unpushed commits BEFORE push
- Always verify push success AFTER push
- If push fails due to divergence, report to user -- do NOT auto-rebase
Finishing Flow
After work is complete on a branch, execute one of these four actions based on context.
Merge to Main
git checkout main
git merge --ff-only <branch> # try fast-forward first
# if ff fails: git merge --no-ff <branch>
# MANDATORY cleanup -- see Post-Merge CleanupPost-Merge Cleanup (MANDATORY final step of every merge)
Applies to ff, --no-ff, and squash merges (PR merged via gh/Gitea too). Squash merges are invisible to git branch --merged.
# from the main checkout, never from inside the worktree
git -C <worktree> status --porcelain --untracked-files=no # must be empty
git worktree remove <worktree> # --force only for untracked build output (node_modules)
git branch -D <branch>
git worktree prune- Uncommitted tracked changes -> REFUSE, keep worktree + branch, report the files.
- Never delete remote branches here. Never touch the main checkout.
- Put the result in the final report (Worktree Cleanup table).
- Stale leftovers:
/worktree-gc(dry run by default).
Create PR
git push -u origin <branch>
gh pr create --title "<title>" --body "<body>"
# keep branch and worktreeKeep Branch
# no action needed -- branch stays as-is
git push -u origin <branch> # optional: push to remote for safetyDiscard Branch
git checkout main
git worktree remove .scaffolding/worktrees/<task_id> 2>/dev/null
git branch -D <branch>
git worktree pruneDoes 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.

