git-workflow

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Git 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

参考文件

ReferenceWhen to Load
references/branching-strategies.md
Managing branches, choosing branching model
references/commit-conventions.md
Writing commits, semantic versioning
references/pull-request-workflow.md
Creating/reviewing PRs, thread resolution, merging
references/ci-cd-integration.md
CI/CD automation, GitHub Actions
references/advanced-git.md
Rebasing, cherry-picking, bisecting
references/github-releases.md
Release management, immutable releases
references/code-quality-tools.md
Shell linting, formatting, smart fixups, structural diffs
参考文件加载场景
references/branching-strategies.md
管理分支、选择分支模型时
references/commit-conventions.md
编写提交信息、使用语义化版本控制时
references/pull-request-workflow.md
创建/评审PR、处理线程、合并PR时
references/ci-cd-integration.md
CI/CD自动化、使用GitHub Actions时
references/advanced-git.md
变基、拣选提交、二分查找时
references/github-releases.md
发布管理、不可变发布时
references/code-quality-tools.md
Shell代码检查、格式化、智能修复、结构化差异对比时

Explicit Content Triggers

明确的内容触发条件

When creating pull requests, load
references/pull-request-workflow.md
for PR structure, size guidelines, and template patterns.
When reviewing PRs or responding to review comments, load
references/pull-request-workflow.md
for review comment levels (blocking/suggestion/nit) and the code review checklist.
When replying to PR review threads or resolving threads, load
references/pull-request-workflow.md
for the GraphQL API patterns for thread replies and resolution.
When merging PRs, load
references/pull-request-workflow.md
for the merge requirements checklist (resolved threads, Copilot review, rebased branch, CI checks).
When merging in repos requiring signed commits with rebase-only strategy, load
references/pull-request-workflow.md
for the local fast-forward merge workflow.
When handling merge conflicts, load
references/pull-request-workflow.md
for conflict resolution strategies.
When choosing a branching strategy, load
references/branching-strategies.md
for Git Flow, GitHub Flow, and Trunk-based patterns.
When writing commit messages, load
references/commit-conventions.md
for Conventional Commits format and semantic versioning rules.
When creating releases, load
references/github-releases.md
for immutable release warnings and recovery patterns.
When running a full PR lifecycle (CI check → resolve comments → merge → cleanup), load
references/pull-request-workflow.md
for the complete PR merge checklist.
When CI is failing on a PR and you need to fix it before merging, load
references/pull-request-workflow.md
for the CI verification and annotation checking patterns.
创建拉取请求(PR)时,加载
references/pull-request-workflow.md
以获取PR结构、尺寸规范及模板模式。
评审PR或回复评审意见时,加载
references/pull-request-workflow.md
以获取评审意见等级(阻止/建议/细微问题)及代码评审检查清单。
回复PR评审线程或处理线程时,加载
references/pull-request-workflow.md
以获取线程回复及处理的GraphQL API模式。
合并PR时,加载
references/pull-request-workflow.md
以获取合并要求检查清单(已处理线程、Copilot评审、已变基分支、CI检查通过)。
在要求签名提交且仅允许变基的仓库中合并PR时,加载
references/pull-request-workflow.md
以获取本地快进合并工作流。
处理合并冲突时,加载
references/pull-request-workflow.md
以获取冲突解决策略。
选择分支策略时,加载
references/branching-strategies.md
以获取Git Flow、GitHub Flow及基于主干的开发模式。
编写提交信息时,加载
references/commit-conventions.md
以获取Conventional Commits格式及语义化版本控制规则。
创建发布版本时,加载
references/github-releases.md
以获取不可变发布的注意事项及恢复方案。
执行完整PR生命周期(CI检查 → 处理意见 → 合并 → 清理)时,加载
references/pull-request-workflow.md
以获取完整的PR合并检查清单。
PR的CI检查失败且需在合并前修复时,加载
references/pull-request-workflow.md
以获取CI验证及注释检查模式。

Conventional Commits (Quick Reference)

Conventional Commits(快速参考)

<type>[scope]: <description>
Types:
feat
(MINOR),
fix
(PATCH),
docs
,
style
,
refactor
,
perf
,
test
,
build
,
ci
,
chore
,
revert
Breaking change: Add
!
after type or
BREAKING CHANGE:
in footer.
<type>[scope]: <description>
类型
feat
(小版本更新)、
fix
(补丁版本更新)、
docs
style
refactor
perf
test
build
ci
chore
revert
破坏性变更:在类型后添加
!
,或在页脚添加
BREAKING CHANGE:

Branch Naming

分支命名规范

bash
feature/TICKET-123-description
fix/TICKET-456-bug-name
release/1.2.0
hotfix/1.2.1-security-patch
bash
feature/TICKET-123-description
fix/TICKET-456-bug-name
release/1.2.0
hotfix/1.2.1-security-patch

GitHub Flow (Default)

GitHub Flow(默认流程)

bash
git checkout main && git pull
git checkout -b feature/my-feature
bash
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
references/github-releases.md
for prevention and recovery patterns.
重要提示:已删除的发布将永久占用标签名称。请确保首次发布即正确无误。
详情请查看
references/github-releases.md
中的预防及恢复方案。

Verification

验证

bash
./scripts/verify-git-workflow.sh /path/to/repository

bash
./scripts/verify-git-workflow.sh /path/to/repository