Git Commit message 编写指南
时间:2021-07-20
本文章向大家介绍Git Commit message 编写指南,主要包括Git Commit message 编写指南使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。
git commit -m "hello world"
Commit message 的格式
每次提交,Commit message 都包括三个部分:Message header,Message body 和 Message footer。
<type>(<scope>): <subject>
// 空一行
<body>
// 空一行
<footer>
其中,Message header 是必需的,Message header 和 Message footer 可以省略。
不管是哪一个部分,任何一行都不得超过72个字符(或100个字符)。这是为了避免自动换行影响美观。
Message header
Message header 部分只有一行,包括三个字段:type(必需)、scope(可选)和subject(必需)。
type
type 用于说明 commit 的类别,只允许使用下面7个标识。
feat:新功能(feature)
fix:修补bug
docs:文档(documentation)
style:格式(不影响代码运行的变动)
refactor:重构(即不是新增功能,也不是修改bug的代码变动)
test:增加测试
chore:构建过程或辅助工具的变动
scope
scope 用于说明 commit 影响的范围,比如数据层、控制层、视图层等等,视项目不同而不同。
subject
subject 是 commit 目的的简短描述,不超过50个字符。
Message body
Message body 部分是对本次 commit 的详细描述,可以分成多行。下面是一个范例。
More detailed explanatory text, if necessary. Wrap it to
about 72 characters or so.
Further paragraphs come after blank lines.
- Bullet points are okay, too
- Use a hanging indent
应该说明代码变动的动机,以及与以前行为的对比。
Message footer
Message footer 部分只用于两种情况。
- 不兼容变动
- 关闭 Issue
Examples
feat($browser): onUrlChange event (popstate/hashchange/polling)
Added new event to $browser:
- forward popstate event if available
- forward hashchange event if popstate not available
- do polling when neither popstate nor hashchange available
Breaks $browser.onHashChange, which was removed (use onUrlChange instead)
fix($compile): couple of unit tests for IE9
Older IEs serialize html uppercased, but IE9 does not...
Would be better to expect case insensitive, unfortunately jasmine does
not allow to user regexps for throw expectations.
Closes #392
Breaks foo.bar api, foo.baz should be used instead
feat(directive): ng:disabled, ng:checked, ng:multiple, ng:readonly, ng:selected
New directives for proper binding these attributes in older browsers (IE).
Added coresponding description, live examples and e2e tests.
Closes #351
style($location): add couple of missing semi colons
docs(guide): updated fixed docs from Google Docs
Couple of typos fixed:
- indentation
- batchLogbatchLog -> batchLog
- start periodic checking
- missing brace
feat($compile): simplify isolate scope bindings
Changed the isolate scope binding options to:
- @attr - attribute binding (including interpolation)
- =model - by-directional model binding
- &expr - expression execution binding
This change simplifies the terminology as well as
number of choices available to the developer. It
also supports local name aliasing from the parent.
BREAKING CHANGE: isolate scope bindings definition has changed and
the inject option for the directive controller injection was removed.
To migrate the code follow the example below:
Before:
scope: {
myAttr: 'attribute',
myBind: 'bind',
myExpression: 'expression',
myEval: 'evaluate',
myAccessor: 'accessor'
}
After:
scope: {
myAttr: '@',
myBind: '@',
myExpression: '&',
// myEval - usually not useful, but in cases where the expression is assignable, you can use '='
myAccessor: '=' // in directive's template change myAccessor() to myAccessor
}
The removed `inject` wasn't generaly useful for directives so there should be no code using it.
参考
https://gitee.com/help/articles/4231
http://www.ruanyifeng.com/blog/2016/01/commit_message_change_log.html
https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit
刻鹄不成尚类鹜,画虎不成反类狗。
原文地址:https://www.cnblogs.com/clipboard/p/15036421.html
- 挑战数据结构和算法面试题——左旋转字符串
- 聚簇因子和执行计划的联系(r3笔记第90天)
- Global eval. What are the options?
- 3d效果的图片轮播
- 关于等待事件"read by other session"(r3笔记第89天)
- URI编码解码和base64
- 阿里大数据竞赛第一名大神github源代码分享(O2O优惠券使用预测)
- 关于导入dump(r3笔记第98天)
- DOM 节点的克隆与删除
- 异步Promise实现
- 《数学之美》拾遗——TF-IDF
- javascript URL实现简易书签
- 爬取淘宝/天猫评论数据的过程
- 通过shell分析表依赖的层级关系(r3笔记第97天)
- JavaScript 教程
- JavaScript 编辑工具
- JavaScript 与HTML
- JavaScript 与Java
- JavaScript 数据结构
- JavaScript 基本数据类型
- JavaScript 特殊数据类型
- JavaScript 运算符
- JavaScript typeof 运算符
- JavaScript 表达式
- JavaScript 类型转换
- JavaScript 基本语法
- JavaScript 注释
- Javascript 基本处理流程
- Javascript 选择结构
- Javascript if 语句
- Javascript if 语句的嵌套
- Javascript switch 语句
- Javascript 循环结构
- Javascript 循环结构实例
- Javascript 跳转语句
- Javascript 控制语句总结
- Javascript 函数介绍
- Javascript 函数的定义
- Javascript 函数调用
- Javascript 几种特殊的函数
- JavaScript 内置函数简介
- Javascript eval() 函数
- Javascript isFinite() 函数
- Javascript isNaN() 函数
- parseInt() 与 parseFloat()
- escape() 与 unescape()
- Javascript 字符串介绍
- Javascript length属性
- javascript 字符串函数
- Javascript 日期对象简介
- Javascript 日期对象用途
- Date 对象属性和方法
- Javascript 数组是什么
- Javascript 创建数组
- Javascript 数组赋值与取值
- Javascript 数组属性和方法
- 轻松应对并发问题,简易的火车票售票系统,第一步 —业务分析
- 【Spark Operator】核数设置Cores/Cores Limit/Cores Request,你搞清楚没有?
- 【Ceph RGW】radosgw_usage_exporter监控用户使用量
- 【Goland】#{key}=#{value},字符串被格式化了?
- Variable变量
- 案例:OGG目标端进程ABENDED处理
- Elasticsearch深分页以及排序查询问题
- 聊聊dubbo-go的HystrixFilter
- 如何将Java工程导出成可以执行的jar
- 利用JSP内置的Application对象实现的网站引用计数
- JSP导入XML不成功的一个原因
- 生产环境日志清理脚本
- fastadmin插件开发之插件目录
- EasySwoole之定时任务面板
- Gradle构建springBoot项目