git-workflow
OfficialGit工作流模式,包括分支策略、提交约定、合并与变基、冲突解决以及适用于各种规模团队的协作开发最佳实践。
What this skill does
When applied, it prepends a system prompt before your request is sent — no extra calls and no change to how you are billed beyond the added tokens.
---
name: git-workflow
description: Git工作流模式,包括分支策略、提交约定、合并与变基、冲突解决以及适用于各种规模团队的协作开发最佳实践。
origin: ECC
---
# Git 工作流模式
Git 版本控制、分支策略与协作开发的最佳实践。
## 何时启用
* 为新项目设置 Git 工作流
* 决定分支策略(GitFlow、主干开发、GitHub Flow)
* 编写提交信息和 PR 描述
* 解决合并冲突
* 管理发布和版本标签
* 让新团队成员熟悉 Git 实践
## 分支策略
### GitHub Flow(简单,推荐大多数场景使用)
最适合持续部署以及中小型团队。
```
main (protected, always deployable)
│
├── feature/user-auth → PR → merge to main
├── feature/payment-flow → PR → merge to main
└── fix/login-bug → PR → merge to main
```
**规则:**
* `main` 始终可部署
* 从 `main` 创建功能分支
* 准备就绪后发起 Pull Request
* 审核通过且 CI 通过后,合并到 `main`
* 合并后立即部署
### 主干开发(高速度团队)
最适合具备强大 CI/CD 和功能开关的团队。
```
main (主干)
│
├── 短期功能分支(最长1-2天)
├── 短期功能分支
└── 短期功能分支
```
**规则:**
* 所有人直接提交到 `main` 或使用极短生命周期的分支
* 功能开关隐藏未完成的工作
* 合并前必须通过 CI
* 每天多次部署
### GitFlow(复杂,基于发布周期)
适合计划性发布和企业级项目。
```
main (生产发布版本)
│
└── develop (集成分支)
│
├── feature/user-auth
├── feature/payment
│
├── release/1.0.0 → 合并到 main 和 develop
│
└── hotfix/critical → 合并到 main 和 develop
```
**规则:**
* `main` 仅包含生产就绪代码
* `develop` 是集成分支
* 功能分支从 `develop` 创建,合并回 `develop`
* 发布分支从 `develop` 创建,合并到 `main` 和 `develop`
* 热修复分支从 `main` 创建,合并到 `main` 和 `develop`
### 何时使用哪种策略
| 策略 | 团队规模 | 发布频率 | 最佳适用场景 |
|----------|-----------|-----------------|----------|
| GitHub Flow | 任意 | 持续 | SaaS、Web 应用、初创公司 |
| 主干开发 | 5 人以上有经验 | 每天多次 | 高速度团队、功能开关 |
| GitFlow | 10 人以上 | 计划性 | 企业、受监管行业 |
## 提交信息
### 常规提交格式
```
<type>(<scope>): <subject>
[optional body]
[optional footer(s)]
```
### 类型
| 类型 | 用途 | 示例 |
|------|---------|---------|
| `feat` | 新功能 | `feat(auth): add OAuth2 login` |
| `fix` | 错误修复 | `fix(api): handle null response in user endpoint` |
| `docs` | 文档 | `docs(readme): update installation instructions` |
| `style` | 格式调整,无代码变更 | `style: fix indentation in login component` |
| `refactor` | 代码重构 | `refactor(db): extract connection pool to module` |
| `test` | 添加/更新测试 | `test(auth): add unit Use this skill
Add a "skill" field with the skill’s ID to your chat completion request. It is applied server-side before your prompt is sent — no extra calls.
{
"model": "gpt-4o-mini",
"skill": "imp-e9e6e8b1-cc97-4fec-bb01-c58ccb8fdbbe",
"messages": [{ "role": "user", "content": "…" }]
}Install the skill, enable it in your dashboard and (optionally) limit it to specific models. It then applies automatically to every matching request — with no "skill" field to send each time.
Set it up in your dashboardMore skills
Set up and use 1Password CLI for sign-in, desktop integration, and reading or injecting secrets.
Create, view, edit, delete, search, move, or export Apple Notes via the memo CLI on macOS.
List, add, edit, complete, or delete Apple Reminders and reminder lists via remindctl.
Create, search, and manage Bear notes via grizzly CLI.
Monitor blogs and RSS/Atom feeds for updates using the blogwatcher CLI.
BluOS CLI (blu) for discovery, playback, grouping, and volume.
Capture frames or clips from RTSP/ONVIF cameras.
Search, install, update, sync, or publish agent skills with the ClawHub CLI and registry.