git

git is a skill for Claude Code from xiaobei930/cc-best. It costs 35 tokens per session (843 once invoked), scanned A, original, MIT.

A guide to using Git for branches, commits, merges, rebases, pull requests, and conflict resolution.

In plain words
What is it for?
Use it when creating branches, writing commits, merging changes, resolving conflicts, or opening pull requests.
Why use it?
It provides consistent ways to organize changes and collaborate without losing track of work or mishandling shared code.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the cc-best plugin — 19 skills, 44 commands, 8 agents, 20 hooks shipped together

Good fit Use it when creating branches, writing commits, merging changes, resolving conflicts, or…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/xiaobei930/cc-best/git
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add xiaobei930/cc-best --skill git
Clone the repo
git clone --depth 1 https://github.com/xiaobei930/cc-best

Made for: Claude Code.

Or install cc-best, the plugin that ships this one along with the rest of its 19 skills, 44 commands, 8 agents, 20 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for git

README.md
[![agentmods](https://agentmods.dev/badge/skills/xiaobei930/cc-best/git.svg)](https://agentmods.dev/skills/xiaobei930/cc-best/git)
Your own site
<a href="https://agentmods.dev/skills/xiaobei930/cc-best/git"><img src="https://agentmods.dev/badge/skills/xiaobei930/cc-best/git.svg" alt="Measured on agentmods" height="20"></a>
Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 843 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00035 $0.00843
Opus 5 $0.00017 $0.00421
Sonnet 5 $0.00007 $0.00169
Haiku 4.5 $0.00003 $0.00084

Measured 3d ago against content hash 776c9067f86e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

git scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/git/SKILL.md · 87 lines

How it starts

The opening of the file, as written. The whole thing — 87 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Git 工作流技能

本技能提供 Git 版本控制的最佳实践。

快速参考

  • 推荐分支模型: GitHub Flow(main + feature 分支 + PR)
  • 提交规范: Conventional Commits(<type>(<scope>): <subject>
  • 合并策略: 功能分支 → Squash Merge,同步主分支 → Rebase,长期分支 → Merge

触发条件

git, commit, branch, merge, rebase, PR, pull request, conflict, stash

工作流程

  1. 检查状态: git status && git branch -a && git log --oneline -5
  2. 选择操作:
场景 执行流程
创建功能分支 git checkout -b feature/xxx → 开发 → 提交
提交代码 git addgit commit → 验证
合并代码 git checkout maingit merge → 推送
解决冲突 查看冲突 → 手动解决 → git addgit rebase --continue
创建 PR 推送分支 → gh pr create → 等待审查
  1. 执行后验证: git status, git log --oneline -3

分支命名规范

feature/add-user-auth     # 功能分支
fix/login-validation      # Bug 修复
hotfix/security-patch     # 热修复
release/v1.2.0            # 发布
refactor/database-layer   # 重构

提交类型

类型 说明 示例
feat 新功能 feat(auth): 添加 OAuth 登录
fix Bug 修复 fix(cart): 修复价格计算错误
docs 文档更新 docs(readme): 更新安装说明
refactor 重构 refactor(api): 重构用户服务
test 测试 test(user): 添加注册测试
chore 构建/工具 chore(deps): 更新依赖
perf 性能优化 perf(query): 优化搜索查询

合并策略选择

场景 推荐策略
功能分支 → main Squash Merge
main → 功能分支 Rebase
长期分支同步 Merge

最佳实践

  1. 小而频繁的提交,每个做一件事
  2. 有意义的提交信息,说明为什么
  3. 经常从主分支同步
  4. PR 前自检(lint、test、review)
  5. 不提交敏感信息
  6. 合并后删除功能分支

子文件索引

文件 内容
commands-reference.md 常用 Git 命令参考
pr-workflow.md Pull Request 流程
hooks-guide.md Git Hooks 指南
delegation.md 委派到专业 Agent

Read the full file on GitHub · 87 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 87 lines · 35 tokens per session scan A 776c9067f86e

Subscribe to this mod's changes

git is a skill published in the GitHub repository xiaobei930/cc-best (50 stars, last pushed 2mo ago), licensed MIT. It adds 35 tokens to every session and 843 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.