All Projects → feflow → Git Commit Style Guide

feflow / Git Commit Style Guide

Licence: mit
Make git commit message more readable and useful.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Git Commit Style Guide

Add And Commit
Add & commit files from a path directly from GitHub Actions
Stars: ✭ 198 (+16.47%)
Mutual labels:  workflow, commit
Conventionalcommits.org
The conventional commits specification
Stars: ✭ 3,552 (+1989.41%)
Mutual labels:  standard, commit
Action Download Artifact
⚙️ A GitHub Action to download an artifact associated with given workflow and commit or other criteria
Stars: ✭ 107 (-37.06%)
Mutual labels:  workflow, commit
Git Town
Generic, high-level Git workflow support!
Stars: ✭ 1,937 (+1039.41%)
Mutual labels:  workflow
Machine Learning Workflow With Python
This is a comprehensive ML techniques with python: Define the Problem- Specify Inputs & Outputs- Data Collection- Exploratory data analysis -Data Preprocessing- Model Design- Training- Evaluation
Stars: ✭ 157 (-7.65%)
Mutual labels:  workflow
Padroes De Commits
📄 Padrão de commits para repositórios.
Stars: ✭ 164 (-3.53%)
Mutual labels:  commit
Alfy
Create Alfred workflows with ease
Stars: ✭ 2,232 (+1212.94%)
Mutual labels:  workflow
Php Conventions
Рекомендации по написанию PHP кода
Stars: ✭ 156 (-8.24%)
Mutual labels:  standard
Git tracker
Some simple tricks that make working with Pivotal Tracker even better... and easier... um, besier!
Stars: ✭ 166 (-2.35%)
Mutual labels:  workflow
Dnscontrol
Synchronize your DNS to multiple providers from a simple DSL
Stars: ✭ 2,089 (+1128.82%)
Mutual labels:  workflow
Octodns
Tools for managing DNS across multiple providers
Stars: ✭ 2,090 (+1129.41%)
Mutual labels:  workflow
Yii2 Workflow
A simple workflow engine for Yii2
Stars: ✭ 157 (-7.65%)
Mutual labels:  workflow
Welabx G6
welabx - antv G6
Stars: ✭ 163 (-4.12%)
Mutual labels:  workflow
Batchflow
BatchFlow helps you conveniently work with random or sequential batches of your data and define data processing and machine learning workflows even for datasets that do not fit into memory.
Stars: ✭ 156 (-8.24%)
Mutual labels:  workflow
Gopablo
🐺 Static site generator.
Stars: ✭ 166 (-2.35%)
Mutual labels:  workflow
Etl unicorn
数据可视化, 数据挖掘, 数据处理 ETL
Stars: ✭ 156 (-8.24%)
Mutual labels:  workflow
Fastmac
Get a MacOS or Linux shell, for free, in around 2 minutes
Stars: ✭ 1,953 (+1048.82%)
Mutual labels:  workflow
Sflive Paris2016 Workflow
Demo app for the new symfony/workflow component
Stars: ✭ 160 (-5.88%)
Mutual labels:  workflow
Expand
DevExpress XAF extension framework. 𝗹𝗶𝗻𝗸𝗲𝗱𝗶𝗻.𝗲𝘅𝗽𝗮𝗻𝗱𝗳𝗿𝗮𝗺𝗲𝘄𝗼𝗿𝗸.𝗰𝗼𝗺, 𝘆𝗼𝘂𝘁𝘂𝗯𝗲.𝗲𝘅𝗽𝗮𝗻𝗱𝗳𝗿𝗮𝗺𝗲𝘄𝗼𝗿𝗸.𝗰𝗼𝗺 and 𝘁𝘄𝗶𝘁𝘁𝗲𝗿 @𝗲𝘅𝗽𝗮𝗻𝗱𝗳𝗿𝗮𝗺𝗲𝘄𝗼𝗿𝗸 and or simply 𝗦𝘁𝗮𝗿/𝘄𝗮𝘁𝗰𝗵 this repository and get notified from 𝗚𝗶𝘁𝗛𝘂𝗯
Stars: ✭ 158 (-7.06%)
Mutual labels:  workflow
Diagram Maker
A library to display an interactive editor for any graph-like data.
Stars: ✭ 2,086 (+1127.06%)
Mutual labels:  workflow

git-commit-style-guide

Packagist

目的

  • 统一团队 Git commit 日志标准,便于后续代码 review,版本发布以及日志自动化生成等等
  • 统一团队的 Git 工作流,包括分支使用、tag 规范、issue 等

Git commit 日志参考案例

总体方案

Git commit日志基本规范

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

所有的 type 类型如下:

type代表某次提交的类型,比如是修复一个bug还是增加一个新的feature。

  • feat: 新增 feature
  • fix: 修复 bug
  • docs: 仅仅修改了文档,比如 README, CHANGELOG, CONTRIBUTE等等
  • style: 仅仅修改了空格、格式缩进、逗号等等,不改变代码逻辑
  • refactor: 代码重构,没有加新功能或者修复 bug
  • perf: 优化相关,比如提升性能、体验
  • test: 测试用例,包括单元测试、集成测试等
  • chore: 改变构建流程、或者增加依赖库、工具等
  • revert: 回滚到上一个版本

格式要求:

# 标题行:50个字符以内,描述主要变更内容
#
# 主体内容:更详细的说明文本,建议72个字符以内。 需要描述的信息包括:
#
# * 为什么这个变更是必须的? 它可能是用来修复一个bug,增加一个feature,提升性能、可靠性、稳定性等等
# * 他如何解决这个问题? 具体描述解决问题的步骤
# * 是否存在副作用、风险? 
#
# 尾部:如果需要的化可以添加一个链接到issue地址或者其它文档,或者关闭某个issue。

Git分支与版本发布规范

  • 基本原则:master为保护分支,不直接在master上进行代码修改和提交。
  • 开发日常需求或者项目时,从master分支上checkout一个feature分支进行开发或者bugfix分支进行bug修复,功能测试完毕并且项目发布上线后,将feature分支合并到主干master,并且打Tag发布,最后删除开发分支。分支命名规范:
    • 分支版本命名规则:分支类型 _ 分支发布时间 _ 分支功能。比如:feat_20170401_fairy_flower
    • 分支类型包括:feat、 fix、refactor三种类型,即新功能开发、bug修复和代码重构
    • 时间使用年月日进行命名,不足2位补0
    • 分支功能命名使用snake case命名法,即下划线命名。
  • Tag包括3位版本,前缀使用v。比如v1.2.31。Tag命名规范:
    • 新功能开发使用第2位版本号,bug修复使用第3位版本号
    • 核心基础库或者Node中间价可以在大版本发布请使用灰度版本号,在版本后面加上后缀,用中划线分隔。alpha或者belta后面加上次数,即第几次alpha:
      • v2.0.0-alpha.1
      • v2.0.0-belta.1
  • 版本正式发布前需要生成changelog文档,然后再发布上线。

如何接入?

接入参考commit-message-test-project项目。具体步骤如下:

  • 第一步:在工程跟目录下的package.json文件加入如下代码所示的scripts和dependencies内容,版本号为3位版本号。
  {
    "name": "application-name",
    "version": "0.1.0",
    "scripts": {
      "commitmsg": "validate-commit-msg",
      "commit": "git-cz ",
      "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0"
    },
    "devDependencies": {
      "commitizen": "^2.3.0",
      "validate-commit-msg": "^2.11.1",
      "conventional-changelog-cli": "^1.2.0",
      "husky": "^0.13.1"
    }
  }
  • 第二步:在工程根目录新建.vcmrc文件,并且文件内容为
{
  "helpMessage": "\nPlease fix your commit message (and consider using https://www.npmjs.com/package/commitizen)\n",
  "types": [
    "feat",
    "fix",
    "docs",
    "style",
    "refactor",
    "perf",
    "test",
    "chore",
    "revert"
  ],
  "warnOnFail": false,
  "autoFix": false
}

接入后的Git commit操作流程

  • 第一步:创建一个feature分支或者bugfix分支
  $ git checkout -b feature_infinite_load    # 切换到一个feature分支或者bug fix分支
  • 第二步:将代码提交到本地Git仓库,并填写符合要求的Commit message格式
  $ git add .
  $ git commit                               # 此处不要加任何参数,比如-m

如下图所示:

  • 第三步:将代码同步到远程Git仓库
  $ git push origin feature_infinite_load    # 将修改发布到远程仓库 
  • 第四步:自动生成changelog,并打Tag发布
  $ tnpm run changelog                    # 使用npm script中的changlog命令直接从git元数据生成日志。
  $ git tag v0.1.0
  $ git push origin v0.1.0
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].