git-workflow
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGit Workflow Skill
Git工作流技能
Expert patterns for Git version control: branching, commits, collaboration, and CI/CD.
Git版本控制的专家级模式:分支、提交、协作及CI/CD集成。
Expertise Areas
专业领域
- Branching: Git Flow, GitHub Flow, Trunk-based development
- Commits: Conventional Commits, semantic versioning
- Collaboration: PR workflows, code review, merge strategies, thread resolution
- CI/CD: GitHub Actions, GitLab CI, branch protection
- 分支管理:Git Flow、GitHub Flow、基于主干的开发
- 提交规范:Conventional Commits、语义化版本控制
- 协作流程:PR工作流、代码评审、合并策略、线程处理
- CI/CD集成:GitHub Actions、GitLab CI、分支保护
Reference Files
参考文件
| Reference | When to Load |
|---|---|
| Managing branches, choosing branching model |
| Writing commits, semantic versioning |
| Creating/reviewing PRs, thread resolution, merging |
| CI/CD automation, GitHub Actions |
| Rebasing, cherry-picking, bisecting |
| Release management, immutable releases |
| Shell linting, formatting, smart fixups, structural diffs |
| 参考文件 | 加载场景 |
|---|---|
| 管理分支、选择分支模型时 |
| 编写提交信息、使用语义化版本控制时 |
| 创建/评审PR、处理线程、合并PR时 |
| CI/CD自动化、使用GitHub Actions时 |
| 变基、拣选提交、二分查找时 |
| 发布管理、不可变发布时 |
| Shell代码检查、格式化、智能修复、结构化差异对比时 |
Explicit Content Triggers
明确的内容触发条件
When creating pull requests, load for PR structure, size guidelines, and template patterns.
references/pull-request-workflow.mdWhen reviewing PRs or responding to review comments, load for review comment levels (blocking/suggestion/nit) and the code review checklist.
references/pull-request-workflow.mdWhen replying to PR review threads or resolving threads, load for the GraphQL API patterns for thread replies and resolution.
references/pull-request-workflow.mdWhen merging PRs, load for the merge requirements checklist (resolved threads, Copilot review, rebased branch, CI checks).
references/pull-request-workflow.mdWhen merging in repos requiring signed commits with rebase-only strategy, load for the local fast-forward merge workflow.
references/pull-request-workflow.mdWhen handling merge conflicts, load for conflict resolution strategies.
references/pull-request-workflow.mdWhen choosing a branching strategy, load for Git Flow, GitHub Flow, and Trunk-based patterns.
references/branching-strategies.mdWhen writing commit messages, load for Conventional Commits format and semantic versioning rules.
references/commit-conventions.mdWhen creating releases, load for immutable release warnings and recovery patterns.
references/github-releases.mdWhen running a full PR lifecycle (CI check → resolve comments → merge → cleanup), load for the complete PR merge checklist.
references/pull-request-workflow.mdWhen CI is failing on a PR and you need to fix it before merging, load for the CI verification and annotation checking patterns.
references/pull-request-workflow.md创建拉取请求(PR)时,加载以获取PR结构、尺寸规范及模板模式。
references/pull-request-workflow.md评审PR或回复评审意见时,加载以获取评审意见等级(阻止/建议/细微问题)及代码评审检查清单。
references/pull-request-workflow.md回复PR评审线程或处理线程时,加载以获取线程回复及处理的GraphQL API模式。
references/pull-request-workflow.md合并PR时,加载以获取合并要求检查清单(已处理线程、Copilot评审、已变基分支、CI检查通过)。
references/pull-request-workflow.md在要求签名提交且仅允许变基的仓库中合并PR时,加载以获取本地快进合并工作流。
references/pull-request-workflow.md处理合并冲突时,加载以获取冲突解决策略。
references/pull-request-workflow.md选择分支策略时,加载以获取Git Flow、GitHub Flow及基于主干的开发模式。
references/branching-strategies.md编写提交信息时,加载以获取Conventional Commits格式及语义化版本控制规则。
references/commit-conventions.md创建发布版本时,加载以获取不可变发布的注意事项及恢复方案。
references/github-releases.md执行完整PR生命周期(CI检查 → 处理意见 → 合并 → 清理)时,加载以获取完整的PR合并检查清单。
references/pull-request-workflow.mdPR的CI检查失败且需在合并前修复时,加载以获取CI验证及注释检查模式。
references/pull-request-workflow.mdConventional Commits (Quick Reference)
Conventional Commits(快速参考)
<type>[scope]: <description>Types: (MINOR), (PATCH), , , , , , , , ,
featfixdocsstylerefactorperftestbuildcichorerevertBreaking change: Add after type or in footer.
!BREAKING CHANGE:<type>[scope]: <description>类型:(小版本更新)、(补丁版本更新)、、、、、、、、、
featfixdocsstylerefactorperftestbuildcichorerevert破坏性变更:在类型后添加,或在页脚添加。
!BREAKING CHANGE:Branch Naming
分支命名规范
bash
feature/TICKET-123-description
fix/TICKET-456-bug-name
release/1.2.0
hotfix/1.2.1-security-patchbash
feature/TICKET-123-description
fix/TICKET-456-bug-name
release/1.2.0
hotfix/1.2.1-security-patchGitHub Flow (Default)
GitHub Flow(默认流程)
bash
git checkout main && git pull
git checkout -b feature/my-featurebash
git checkout main && git pull
git checkout -b feature/my-feature... work ...
... 开发工作 ...
git push -u origin HEAD
gh pr create && gh pr merge --squash
For code quality tools (shellcheck, shfmt, git-absorb, difft), see `references/code-quality-tools.md`.git push -u origin HEAD
gh pr create && gh pr merge --squash
如需了解代码质量工具(shellcheck、shfmt、git-absorb、difft),请查看`references/code-quality-tools.md`。GitHub Immutable Releases
GitHub不可变发布
CRITICAL: Deleted releases block tag names PERMANENTLY. Get releases right first time.
See for prevention and recovery patterns.
references/github-releases.md重要提示:已删除的发布将永久占用标签名称。请确保首次发布即正确无误。
详情请查看中的预防及恢复方案。
references/github-releases.mdVerification
验证
bash
./scripts/verify-git-workflow.sh /path/to/repositoryContributing: https://github.com/netresearch/git-workflow-skill
bash
./scripts/verify-git-workflow.sh /path/to/repository