Equip your AI agent with expert Git discipline — commits, branches, merges, rebases, conflict resolution, and safe recovery workflows.
npx clawhub@latest install gitPlatforms
The Git skill gives your AI agent a comprehensive, opinionated playbook for day-to-day version control. It covers the full Git lifecycle — commits, branching strategies, rebasing, conflict resolution, history inspection, and recovery — while enforcing safe practices like --force-with-lease, meaningful commit messages, and pre-merge hygiene. Install this skill whenever your agent will interact with Git repositories so it applies consistent discipline instead of improvising.
npx clawhub@latest install gitClick the Install button at the top of this page for one-click setup
git bisect, recover lost commits via git reflog, or undo changes safely.The skill enforces --force-with-lease over --force to prevent overwriting teammates' work, and prohibits force-pushing to shared branches like main/master. A built-in safety checklist must be satisfied before any destructive operation such as reset --hard or rebase.
Includes step-by-step flows for Feature Branch and Hotfix scenarios, including when to squash commits, how to sync with git fetch --all --prune, and how to tag releases. Designed to fit both trunk-based and gitflow-style teams.
After editing conflicted files, the skill verifies no conflict markers remain using grep, confirms the code builds, and offers an escape hatch via git merge --abort when a merge becomes too complex. Rebasing is suggested as an alternative when merges get messy.
Covers git reflog for recovering lost commits (up to ~90 days), restoring deleted branches by SHA, and undoing commits without losing work using git reset --soft. Also includes a full git bisect workflow for pinpointing regression-introducing commits.
The skill mandates the type(scope): description commit message format with a first line under 72 characters, using standard types (feat, fix, docs, refactor, etc.). This keeps history readable and compatible with automated changelog tools.
Documents and guards against frequent Git pitfalls: detached HEAD state, case-sensitivity issues between macOS/Windows and Linux CI, submodule cloning errors, stash-pop conflicts, and committing large files or secrets. Use git add -p for granular partial staging.
An agent scaffolds a new feature, creates a branch from main, commits incrementally with conventional messages, rebases onto the latest main before pushing, squashes fixup commits, and opens a PR-ready branch — all without manual Git intervention.
When a production bug is found, the agent checks out a hotfix/ branch from main, applies the fix, merges to both main and develop, tags the release, and cleans up the branch — following the documented hotfix flow precisely.
The agent runs git bisect to binary-search through commit history, marking commits good or bad based on automated test results, until it identifies the exact commit that introduced a bug.
During a long-running feature rebase, the agent resolves conflicts file by file, verifies no <<</>>> markers remain, confirms the build passes, and continues the rebase — or aborts cleanly if the conflict is too complex.
npx clawhub@latest install gitPlatforms
Log in to write a review
No reviews yet. Be the first to share your experience!