Git
Commits, branches, merges, and rebases Git repositories, resolves conflicts, and recovers lost history. Use when the work touches a repo, commit, branch…
от clawic★ 23 звезды на GitHub
Установить Git в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
User preferences and memory live in ~/Clawic/data/git/ (see setup.md on first use, memory-template.md for the file format). If you have data at an old location (~/git/ or ~/clawic/git/), move it to ~/Clawic/data/git/, and say in one line that you moved it and from where.
Configuration
User-dependent variables. Defaults apply until the user states a preference; store them in ~/Clawic/data/git/config.yaml.
| Variable | Type | Default | Effect |
|---|---|---|---|
| integration_style | rebase | merge | squash | repo-default | repo-default | How branches get combined and what pull does; repo-default reads the last 20 merges (git log --merges --oneline -20) and follows what the repo already does |
| commit_style | conventional | plain | repo-default | repo-default | Shape of every generated commit subject (Commit Discipline); repo-default copies the style found in git log --oneline -20 |
| branch_naming | text (pattern) | type/topic | Template used when creating branches, lowercase and hierarchical by default |
| protected_branches | list | main, master | Branches never committed to, rewritten, or force-pushed (Core Rule 2, Push gate); a request that targets one becomes "branch first, then propose the merge" |
| force_push_policy | never | own-branches | any | own-branches | Governs the Push gate: never turns every rewrite into a git revert; any still requires --force-with-lease |
| subject_max | number (chars, 50-100) | 72 | Hard stop for every generated commit subject (Core Rule 6) and the length any commit-msg gate enforces |
| message_language | text (language) | repo-default | repo-default | Language of generated commit subjects, bodies, and tag messages; repo-default copies the language already in git log --oneline -20 |
| remote_host | github | gitlab | bitbucket | gitea | other | github | Selects PR-vs-MR wording, blob size limits, and squash-merge semantics quoted in review and release guidance |
| signing | off | ssh | gpg | off | Adds signing flags and commit.gpgsign setup to commit and tag flows |
Preference areas to record as the user reveals them:
- tooling — CLI vs GUI vs IDE Git, hosting CLI in use, pre-commit framework, mergetool of choice
- conventions — subject format, ticket-ID placement, tag scheme, trailers such as
Co-authored-by, monorepo tag prefixes - thresholds — body-length and file-count limits a commit may reach, the large-file guard's size (
--above=), reflog retention (gc.reflogExpireUnreachable), clone depth and filter in CI - restrictions — repos, paths, or file types the agent must leave alone; operations banned outright (no rebase, no
filter-repo); compliance regimes demanding signed or reviewed commits - platform — hosting provider, SSH vs HTTPS, monorepo vs polyrepo, Windows/macOS line-ending and case sensitivity constraints
- safety posture — whether the agent may commit or push unprompted, confirmation before
--hard/clean -f/history rewrites - work order — commit granularity, whether to sync before starting, review gates expected before a push
- cadence — how often to fetch/prune, when to run maintenance on large clones
When To Use
- Any task touching a Git repository: staging, commits, branches, merges, rebases, tags, stashes, submodules.
- Something looks lost — deleted branch, bad rebase, hard reset, vanished stash: recovery is a first-class use (→ Recovery Playbook,
recovery.md). - Git refuses to run and the message is opaque (
index.lock, non-fast-forward, dubious ownership, detached HEAD) →errors.md. - Before any history rewrite or force push: run the Output Gates below first.
- Investigating when a behavior broke, who changed a line, or where code came from →
forensics.md. - Not for CI pipeline configuration — GitHub workflows are
github-actions, GitLab pipelines aregitlab; writing the PR description itself ispull-request.
Quick Reference
| Situation | File |
|---|---|
| Staging surgery, splitting a mixed change, wording a message, stashing | commits.md |
| Creating or switching branches, merge vs rebase, stacked branches | branching.md |
| A merge or rebase stopped on conflicts | conflicts.md |
| Undoing: reset, revert, amend, rewriting a branch before review | history.md |
| Work looks lost: bad reset, dropped stash, deleted branch, detached commits | recovery.md |
| Git printed an error and refuses to proceed | errors.md |
| "When did this break", "who wrote this line", "where did this code go" | forensics.md |
| Push/pull friction, review flow, force-pushing on a shared branch | collaboration.md |
| Forks, upstreams, mirrors, moving or splitting a repository | remotes.md |
| Two checkouts at once: hotfix mid-refactor, parallel agent tasks | worktrees.md |
| Nested repositories: submodules, subtrees, vendored code | submodules.md |
| Slow clone or status, monorepo scale, huge files, LFS | `large-repos.md |
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- _meta.json
- branching.md
- collaboration.md
- commands.md
- commits.md
- config.md
- conflicts.md
- errors.md
- forensics.md
- history.md
- hooks.md
- large-repos.md
- memory-template.md
- recovery.md
- releases.md
- remotes.md
- scripting.md
- secrets.md
- setup.md
- submodules.md
- worktrees.md
FAQ
Что делает скилл Git?
Commits, branches, merges, and rebases Git repositories, resolves conflicts, and recovers lost history. Use when the work touches a repo, commit, branch, merge, rebase, stash, tag, or submodule; when Git refuses a command — index.lock exists, push rejected as non-fast-forward, detached HEAD, dubious ownership, unrelated histories, conflict markers left behind; when something looks lost after a hard reset, a bad rebase, a deleted branch, or a dropped stash; when splitting a mixed change, wording commit messages, cleaning history before review, or force-pushing without wrecking a teammate's work; when a credential or a huge file got committed; when setting up worktrees, hooks, LFS, sparse checkout, signing, or separate work and personal identities. Not for CI pipeline YAML (github-actions, gitlab) or for composing the pull request description itself (pull-request).
Как установить скилл Git?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Git запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…