Skip to content
cccskills
FreePublished on GitHub

git

Git version control best practices: branching, commits, merging, conflict resolution, PR workflows. Use when managing branches, creating commits, merging code, or resolving conflicts.

The English summary is being prepared. Showing the original description.

See how to install

Files included (5)

  • SKILL.md3.3 KB
  • commands-reference.md1.6 KB
  • delegation.md850 B
  • hooks-guide.md604 B
  • pr-workflow.md720 B

SKILL.md (original)

Review the instructions the agent will receive before you install.

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 add → git commit → 验证
合并代码git checkout main → git merge → 推送
解决冲突查看冲突 → 手动解决 → git add → git 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 登录
fixBug 修复fix(cart): 修复价格计算错误
docs文档更新docs(readme): 更新安装说明
refactor重构refactor(api): 重构用户服务
test测试test(user): 添加注册测试
chore构建/工具chore(deps): 更新依赖
perf性能优化perf(query): 优化搜索查询

合并策略选择

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

最佳实践

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

子文件索引

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

记住: Git 是协作的基石——清晰的分支策略和提交规范让团队协作事半功倍。

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

api

Free

RESTful API design patterns and best practices. Use when creating endpoints, designing APIs, or implementing routes.

The English summary is being prepared. Showing the original description.

xiaobei930/cc-best48Updated Jun 13, 2026

Architecture design skill: ADR records, system design checklists, scalability assessment, architecture patterns. Use for complex system design and architecture decisions.

The English summary is being prepared. Showing the original description.

xiaobei930/cc-best48Updated Jun 13, 2026

Backend development patterns for services, error handling, logging, caching. Use when building backend services, APIs, or microservices.

The English summary is being prepared. Showing the original description.

xiaobei930/cc-best48Updated Jun 13, 2026

Strategic compaction skill: suggests context compression at logical breakpoints. Use to suggest compaction at logical intervals during development sessions.

The English summary is being prepared. Showing the original description.

xiaobei930/cc-best48Updated Jun 13, 2026

Database design, query optimization, migrations, and indexing. Use when designing schemas, writing queries, or managing migrations.

The English summary is being prepared. Showing the original description.

xiaobei930/cc-best48Updated Jun 13, 2026

debug

Free

Systematic debugging methods, log analysis, and performance diagnostics. Use when debugging issues, analyzing errors, or troubleshooting incidents.

The English summary is being prepared. Showing the original description.

xiaobei930/cc-best48Updated Jun 13, 2026

See all skills by xiaobei930

Report a problem with this skill