From 64f2e8fe4c31b488d9241ef0763bee048e703dc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=AF=E9=92=8A?= Date: Thu, 24 Mar 2022 06:46:58 +0000 Subject: [PATCH] =?UTF-8?q?Update=202.git=E6=8F=90=E4=BA=A4=E8=A7=84?= =?UTF-8?q?=E8=8C=83.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- git规范/2.git提交规范.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/git规范/2.git提交规范.md b/git规范/2.git提交规范.md index bea752a..5a4ba52 100644 --- a/git规范/2.git提交规范.md +++ b/git规范/2.git提交规范.md @@ -15,19 +15,30 @@ git作为一个开发人员必不可少的工具,代码提交也是日常一 ## 使用什么规范 -Conventional Commits(约定式提交规范),是目前使用最广泛的提交信息规范,其主要受 [AngularJS规范](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines) 的启发。 +[Conventional Commits](https://www.conventionalcommits.org/zh-hans/v1.0.0/)(约定式提交规范),是目前使用最广泛的提交信息规范,其主要受 [AngularJS规范](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines) 的启发。下面是一个规范信息的结构: + +``` +[optional scope]: +//空一行 +[optional body] +//空一行 +[optional footer(s)] +``` + -[commit message convention](https://www.conventionalcommits.org/zh-hans/v1.0.0/) ## 如何约束规范 怎么确保每个提交都能符合规范呢,最好的方式就是通过工具来生成和校验,commitizen是一个nodejs命令行工具,通过交互的方式,生成符合规范的git commit -对于开发人员,各种IDE上可以安装插件来配置提交规范。比如jb的IDE,可以安装 Git Commit Template 插件来实现。 +对于开发人员,各种IDE上可以安装插件来配置提交规范。比如 jetbrains 的IDE,可以安装 Git Commit Template 插件来实现。 对于git服务器,可以配置 git hooks 来约束提交。 + + +