Git Commit 规范

本文最后更新于:4 个月前

  • git commit 规范

    • Header

      type (scope) : subject

      type的几种类型

      • feat: 新功能

      • fix: 修补bug

      • docs: 文档

      • style: 格式

      • refactor: 重构

      • test: 测试

      • chore: 构建工程或者辅助工具的变动

      subject:

      • 以动词开头,使用第一人称现在时

      • 第一个字母小写

      • 结尾不加符号

    • Body

    • Footer

      适用情况:

      • 不兼容变动

        当前代码和上一个版本不兼容,则以BREAKING CHANGE开头

      • 关闭issue

        Closes #123

        关闭123号issue

      • revert

        撤销以前的commit,以revert:开头,后面紧跟着被撤销Commit的Header