• 一个Git Commit Message模板


    一个统一的commit消息模板可以约束团队成员使用一致的方式提交变更信息,这样也方便集成工具进行合规检查。
    通常来讲,commit信息应该包含如下内容:

    <type>(<scope>): <subject>
    <BLANK LINE>
    <body>
    <BLANK LINE>
    <footer>
    

    type表示commit类型,可选值如下:
    1.feat: A new feature
    2.fix: A bug fix
    3.docs: Documentation only changes
    4.style: Changes that do not affect the meaning of the code (white-space, formatting, etc)
    5.refactor: A code change that neither fixes a bug nor adds a feature
    6.perf: A code change that improves performance
    7.test: Adding missing tests or correcting existing tests
    8.build: Changes that affect the build system or external dependencies (e.g: gulp, npm)
    9.ci:Changes to our CI configuration files and scripts (e.g: Travis, Circle, BrowserStack)
    10.chore: Other changes that don’t modify src or test files
    11.revert: Reverts a previous commit

    scope表示影响范围,如:route, component, utils, build等
    subject表示commit概述,建议符合50/72 formatting
    body表示具体修改的内容,可以分为多行,每一行建议符合50/72 formatting
    footer是一些备注信息, 通常是BREAKING CHANGE或修复的BUG链接,如:issue #123

    变更消息模板可以通过文件的方式固话下来,这样在每次提交变更的时候参照模板填写对应的信息。
    一个完整的模板内容如下:

    
    # head: <type>(<scope>): <subject>
    # - type: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert
    # - scope: can be empty (eg. if the change is a global or difficult to assign to a single component), e.g: route, component, utils, build...
    # - subject: start with verb (such as 'change'), 50-character line
    #
    # body: 72-character wrapped. Multiple lines separated by “-”, This should answer:
    # * Why was this change necessary?
    # * How does it address the problem?
    # * Are there any side effects?
    #
    # footer: 
    # - Include a link to the ticket, if any.
    # - BREAKING CHANGE
    #
    # e.g:
    # <type>(<scope>): <subject>
    # <BLANK LINE>
    # <body>
    # <BLANK LINE>
    # <footer>
    # 
    # types:
    #
    # feat:     A new feature 
    # fix:      A bug fix 
    # docs:     Documentation only changes 
    # style:    Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc) 
    # refactor: A code change that neither fixes a bug nor adds a feature 
    # perf:     A code change that improves performance 
    # test:     Adding missing tests or correcting existing tests
    # build:    Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm) 
    # ci:       Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs) 
    # chore:    Other changes that don't modify src or test files 
    # revert:   Reverts a previous commit
    
    

    可以将上述模板信息保存在文件"~/.gitmessage "中并添加为git的commit模板:
    修改 ~/.gitconfig,添加:

    [commit]
    template = ~/.gitmessage
    


    作者:编程随笔
    出处:http://www.cnblogs.com/nuccch/
    声明:本文版权归作者和博客园共有,欢迎转载,但请在文章页面明显位置给出原文连接。

  • 相关阅读:
    页面内容[置顶] 采用Div+Css布局——牛腩
    区域函数[置顶] linux 3.4.10 内核内存管理源代码分析5:伙伴系统初始化
    安装应用android批量安装APK
    选择版本Win7系统VS2010下搭建qt开发环境
    字体格式The format of Oracle tnsnames.ora file
    程序执行vhdl中延时器的编写
    概率链接nbu 2416 奇怪的散步
    中国主题ASP.Net课堂实验4
    要求终点HDU1010:Tempter of the Bone
    解决方案编程苦B和二B程序员别忘了养生
  • 原文地址:https://www.cnblogs.com/nuccch/p/15531386.html
Copyright © 2020-2023  润新知