zoukankan      html  css  js  c++  java
  • 一个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/
    声明:本文版权归作者和博客园共有,欢迎转载,但请在文章页面明显位置给出原文连接。

  • 相关阅读:
    封装了一个简单的筛选菜单控件
    安卓存储资源
    处理webp加所有的jpg到指定路径
    苹果内购
    JavaScript关于md5加密
    JavaScript关于sha1加密
    h5跳转
    python遍历文件(替换)
    python遍历文件
    安卓点击home键重启
  • 原文地址:https://www.cnblogs.com/nuccch/p/15531386.html
Copyright © 2011-2022 走看看