Openclaw-master-skills Git (Essentials + Workflows + Advanced)
Full version control coverage with essential commands, team workflows, branching strategies, and recovery techniques.
install
source · Clone the upstream repo
git clone https://github.com/LeoYeAI/openclaw-master-skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/LeoYeAI/openclaw-master-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/git" ~/.claude/skills/leoyeai-openclaw-master-skills-git-essentials-workflows-advanced && rm -rf "$T"
OpenClaw · Install into ~/.openclaw/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/LeoYeAI/openclaw-master-skills "$T" && mkdir -p ~/.openclaw/skills && cp -r "$T/skills/git" ~/.openclaw/skills/leoyeai-openclaw-master-skills-git-essentials-workflows-advanced && rm -rf "$T"
manifest:
skills/git/SKILL.mdsafety · automated scan (low risk)
This is a pattern-based risk scan, not a security review. Our crawler flagged:
- git push --force
Always read a skill's source content before installing. Patterns alone don't mean the skill is malicious — but they warrant attention.
source content
Setup
On first use, read
setup.md. Default: best practices mode (no config needed).
When to Use
User needs Git expertise — from basic operations to complex workflows. Agent handles branching, merging, rebasing, conflict resolution, and team collaboration patterns.
Architecture
Memory in
~/git/. See memory-template.md for structure.
~/git/ └── memory.md # User preferences (optional)
Quick Reference
| Topic | File |
|---|---|
| Essential commands | |
| Advanced operations | |
| Branch strategies | |
| Conflict resolution | |
| History and recovery | |
| Team workflows | |
| Setup | |
| Memory | |
Core Rules
- Never force push to shared branches — Use
on feature branches only--force-with-lease - Commit early, commit often — Small commits are easier to review, revert, and bisect
- Write meaningful commit messages — First line under 72 chars, imperative mood
- Pull before push — Always
before pushing to avoid merge commitsgit pull --rebase - Clean up before merging — Use
to squash fixup commitsgit rebase -i
Team Workflows
Feature Branch Flow:
from maingit checkout -b feature/name- Make commits, push regularly
- Open PR, get review
- Squash and merge to main
- Delete feature branch
Hotfix Flow:
from maingit checkout -b hotfix/issue- Fix, test, commit
- Merge to main AND develop (if exists)
- Tag the release
Daily Sync:
git fetch --all --prune git rebase origin/main # or merge if team prefers
Commit Messages
- Use conventional commit format:
type(scope): description - Keep first line under 72 characters
- Types:
,feat
,fix
,docs
,style
,refactor
,testchore
Push Safety
- Use
instead ofgit push --force-with-lease
— prevents overwriting others' work--force - If push rejected, run
before retryinggit pull --rebase - Never force push to main/master branch
Conflict Resolution
- After editing conflicted files, verify no markers remain:
grep -r "<<<\|>>>\|===" . - Test that code builds before completing merge
- If merge becomes complex, abort with
and trygit merge --abort
insteadgit rebase
Branch Hygiene
- Delete merged branches locally:
git branch -d branch-name - Clean remote tracking:
git fetch --prune - Before creating PR, rebase feature branch onto latest main
- Use
to squash messy commits before pushinggit rebase -i
Safety Checklist
Before destructive operations (
reset --hard, rebase, force push):
- Is this a shared branch? → Don't rewrite history
- Do I have uncommitted changes? → Stash or commit first
- Am I on the right branch? →
to verifygit branch - Is remote up to date? →
firstgit fetch
Common Traps
- git user.email wrong — Verify with
before important commitsgit config user.email - Empty directories — Git doesn't track them, add
.gitkeep - Submodules — Always clone with
--recurse-submodules - Detached HEAD — Use
to return to previous branchgit switch - - Push rejected — Usually needs
firstgit pull --rebase - stash pop on conflict — Stash disappears. Use
insteadstash apply - Large files — Use Git LFS for files >50MB, never commit secrets
- Case sensitivity — Mac/Windows ignore case, Linux doesn't — causes CI failures
Recovery Commands
- Undo last commit keeping changes:
git reset --soft HEAD~1 - Discard unstaged changes:
git restore filename - Find lost commits:
(keeps ~90 days of history)git reflog - Recover deleted branch:
git checkout -b branch-name <sha-from-reflog> - Use
for partial staging when commit mixes multiple changesgit add -p
Debugging with Bisect
Find the commit that introduced a bug:
git bisect start git bisect bad # current commit is broken git bisect good v1.0.0 # this version worked # Git checks out middle commit, test it, then: git bisect good # or git bisect bad # Repeat until Git finds the culprit git bisect reset # return to original branch
Quick Summary
git status -sb # short status with branch git log --oneline -5 # last 5 commits git shortlog -sn # contributors by commit count git diff --stat HEAD~5 # changes summary last 5 commits git branch -vv # branches with tracking info git stash list # pending stashes
Related Skills
Install with
clawhub install <slug> if user confirms:
— GitLab CI/CD and merge requestsgitlab
— Containerization workflowsdocker
— Code quality and best practicescode
Feedback
- If useful:
clawhub star git - Stay updated:
clawhub sync