当前位置: 首页 > news >正文

git提交管理

git提交管理

scoop install nodejs
# windows
npm install --save-dev @commitlint/config-conventional @commitlint/cli
# non-windows
npm install --save-dev @commitlint/{cli,config-conventional}
# windows将commitlint.config.js修改为utf8编码, 默认utf16编码
echo "export default { extends: ['@commitlint/config-conventional'] };" > commitlint.config.js
# 安装hook工具
npm install --save-dev husky
npx husky init
# Add commit message linting to commit-msg hook
echo "npx --no -- commitlint --edit \$1" > .husky/commit-msg
# Windows users should use ` to escape dollar signs
echo "npx --no commitlint --edit `$1" > .husky/commit-msg

# Test simple usage
npx commitlint --from HEAD~1 --to HEAD --verbose

测试

一定会报错的git提交

git commit -m "foo: this will fail"
#  husky > commit-msg
No staged files match any of provided globs.
⧗   input: foo: this will fail
✖   type must be one of [build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test] [type-enum]

✖   found 1 problems, 0 warnings
ⓘ   Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint

husky - commit-msg script failed (code 1)

reference

  • commitlint

相关文章:

  • Github 仓库 git clone 速度过慢解决方案
  • 模板字符串【ES6】
  • Oracle VM VirtualBox 7.1 安装与虚拟机创建全流程指南(Windows平台)
  • txt 转 json 使用python语言
  • 初步理解RNN和LSTM
  • 计算机毕业设计SpringBoot+Vue.js高校办公室行政事务管理系统(源码+文档+PPT+讲解)
  • 大唐杯——阶段二01
  • Bandicam录屏软件,设置延时录制
  • 深入理解Web通信基础:HTTP响应码、请求方法与协议安全
  • MybatisPlus详细使用
  • 使用Node.js打造交互式脚手架,简化模板下载与项目创建
  • 数据结构(初阶)(八)----排序
  • 【Linux】进程信号
  • 基于互联网协议的诊断通信(DoIP)
  • NLP基础之传统RNN模型
  • 物联网 智慧水库管理系统中集成无人机巡逻和隔空喊话
  • 介绍一下聚簇索引和非聚簇索引的定义和区别,以及优缺点?
  • 容器运行时详解
  • web3.0简介
  • 【EB-07】TC397 Tresos 导入通信ARXML
  • 大观网站建设/百度免费下载安装
  • 厦门seo网络优化公司/搜索引擎优化要考虑哪些方面?
  • wap免费网站/兰州百度推广的公司
  • 帮别人做网站违法吗/长沙电商优化
  • 做ppt设计师哪个网站好/2021年年度关键词
  • 网站记录登录账号怎么做/网页链接制作生成