ZBLOG

google git commit 规范和举例

Google 的 Git commit 规范主要包括以下内容:

  1. 标题:必填,简洁明了地描述本次提交的内容,不超过 50 个字符。

  2. 内容:可选,具体说明本次提交的详细信息。

  3. 类型:必填,标明本次提交的类型。常见的类型有:

    • feat: 新功能
    • fix: 修复 bug
    • docs: 文档更新
    • style: 代码格式调整(不影响功能)
    • refactor: 重构代码(既不是新增功能也不是修复 bug)
    • test: 添加或修改测试用例
    • chore: 其他修改(如构建流程、依赖管理等)
  4. 范围:可选,标明本次提交涉及到的模块或文件夹。

  5. 关键词:可选,标明本次提交与某个 issue 相关联。

下面是一个 Google 的 Git commit 规范举例:

feat(video): add support for multiple resolutions

This commit adds the ability to switch between different resolutions while watching a video.

Resolutions can be selected from a drop-down menu in the player controls.

Closes #1234

这个示例中,commit 标题为 “feat(video): add support for multiple resolutions”,表示添加了视频多分辨率支持。其中,“feat” 表示本次提交类型为新功能,“video” 表示涉及到视频模块。“Closes #1234” 则表示该 commit 关联了编号为 1234 的 issue。

本站部分文章来源于网络,版权归原作者所有,如有侵权请联系站长删除。
转载请注明出处:https://golang.0voice.com/?id=5685

分享:
扫描分享到社交APP
上一篇
下一篇
发表列表
游客 游客
此处应有掌声~
评论列表

还没有评论,快来说点什么吧~

联系我们

在线咨询: 点击这里给我发消息

微信号:3007537140

上班时间: 10:30-22:30

关注我们
x

注册

已经有帐号?