美文网首页Git
git commit 规范参考

git commit 规范参考

作者: alanwhy | 来源:发表于2020-10-22 10:56 被阅读0次

Angular 团队的 commit 规范

它的 message 格式如下:

<type>(<scope>): <subject>
// 空一行
<body>
// 空一行
<footer>

分别对应 Commit message 的三个部分:Header,Body 和 Footer。

Header

Header 部分只有一行,包括三个字段:type(必需)、scope(可选)和subject(必需)。

  • type: 用于说明 commit 的类型。一般有以下几种:
  • feat: 新增feature
  • fix: 修复bug
  • docs: 仅仅修改了文档,如readme.md
  • style: 仅仅是对格式进行修改,如逗号、缩进、空格等。不改变代码逻辑。
  • refactor: 代码重构,没有新增功能或修复bug
  • perf: 优化相关,如提升性能、用户体验等。
  • test: 测试用例,包括单元测试、集成测试。
  • chore: 改变构建流程、或者增加依赖库、工具等。
  • revert: 版本回滚
  • scope: 用于说明 commit 影响的范围,比如: views, component, utils, test...
  • subject: commit 目的的简短描述

Body

对本次 commit 修改内容的具体描述, 可以分为多行。如下所示:

# body: 72-character wrapped. This should answer:
# * Why was this change necessary?
# * How does it address the problem?
# * Are there any side effects?
# initial commit

Footer

一些备注, 通常是 BREAKING CHANGE(当前代码与上一个版本不兼容) 或修复的 bug(关闭 Issue) 的链接。

原文链接:# 你可能已经忽略的git commit规范

相关文章

  • git提交规范

    git的规范和相关科普知识 git commit 的规范要求(参考Angular团队) message格式如下: ...

  • git commit 规范参考

    Angular 团队的 commit 规范 它的 message 格式如下: 分别对应 Commit messag...

  • 一个可供参考的 git commit message 规范

    一个可供参考的 git commit message 规范

  • 我的git学习日志

    关于提交规范(git commit conventions) 参考文献: 你可能会忽略的 Git 提交规范Comm...

  • Git规范

    规范 git的使用流程建议参考“Git使用规范流程”.[3] 建议a.在特性开发时,commit要以逻辑为单位,鼓...

  • 使用 git hook 规范 Android 项目

    引言 本文所说的『规范』包含两个部分 git commit 是注释的规范 git commit 时对代码规范的检查...

  • 2021-04-25 git commit的一些工具库

    建议阅读:git commit 规范参考[https://www.jianshu.com/p/cac0fe9c34...

  • git commit规范

    git commit规范 git-commit规范 在多人协作项目中,如果代码风格统一、代码提交信息的说明准确,那...

  • gitflow 规范及工具整理

    gitflow 进阶规范 git cz 通过工具 git-cz 规范 git commit 提交信息。 使用 gi...

  • GIT 规范

    git 规范 git 规范一般包括两点:分支管理规范和 git commit 规范。 分支管理规范 一个项目可以创...

网友评论

    本文标题:git commit 规范参考

    本文链接:https://www.haomeiwen.com/subject/gyeumktx.html