git cz 规范化提交
安装
sudo npm install commitizen -g
or
sudo cnpm install commitizen -g
初始化
commitizen init cz-conventional-changelog --save-dev --save-exact
or
commitizen init cz-conventional-changelog --yarn --dev --exact
添加
"scripts": {"serve": "vue-cli-service serve","build": "vue-cli-service build","commit": "git add . && git-cz"
},
提交
npm run commit
提交示例
1.开始提交
➜ Alan git:(master) ✗ npm run commit
Debugger attached.> lun@0.1.0 commit /Users/axzq/Alan/lun/lun
> git-czDebugger attached.
cz-cli@4.2.4, cz-conventional-changelog@3.3.0? Select the type of change that you're committing: (Use arrow keys)
❯ 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
(Move up and down to reveal more choices)
选中提交类型后回车
type用于说明 commit 的提交性质。
值 | 描述 |
---|---|
feat | 新增一个功能 |
docs | 文档变更 |
style | 代码格式(不影响功能,例如空格、分号等格式修正) |
refactor | 代码重构 |
fix | 修复一个Bug |
perf | 改善性能 |
test | 测试 |
build | 变更项目构建或外部依赖(例如scopes: webpack、gulp、npm等) |
ci | 更改持续集成软件的配置文件和package中的scripts命令,例如scopes: Travis, Circle等 |
chore | 变更构建流程或辅助工具 |
revert | 代码回退 |
2.修改文件
cz-cli@4.2.4, cz-conventional-changelog@3.3.0? Select the type of change that you're committing: feat: A new feature
? What is the scope of this change (e.g. component or file name): (press enter to skip)
输入已被修改的文件后回车
例:src/views/hello.vue
3.输入提交描述
? Write a short, imperative tense description of the change (max 89 chars):(0) the commit add a hello page
剩下的可以一路回车
需要终止按crl+c
git cz 规范化提交相关推荐
- git规范化提交 git cz
1 安装git cz指令 git指令提交代码的时候,可以通过git cz指令来让提交更规范一些,比如写上提交的代码写了哪些功能.修改了哪些文件等等信息,也可以方便自己日后查看 安装指令: npm in ...
- git cz 提交 具体明细
一.使⽤ vue-cli 创建项⽬ 1.1 创建最新的 vue3 项⽬,终端输⼊ vue create 项⽬名称 二.eslint 2.1 打开项⽬中的 .eslintrc.js ⽂件 module. ...
- 你不得不掌握的前端提交规范(git cz)
背景 最近在提交代码的时候发现每次提交的代码说明都是层次不齐的,看上去让人感觉到特别的凌乱.第一:让人看上去感觉这个程序猿好像不是"正规"出身,再一让自己在回溯代码的时候没有任何头 ...
- Windows安装Git cz (commitizen)
git cz是git的一个插件,git本身并不提供,但其提供了非常强的格式管理以及良好的操作模式,使其可以完全替代git commit. Windows使用此工具需要使用windows的cmd或者po ...
- git cz: Missing script: “test“ To see a list of scripts, run: npm run
git cz报错 情况1: git cz cz-cli@4.2.4, cz-conventional-changelog@3.3.0? Select the type of change that y ...
- Git统计个人提交代码行数
1. Git统计个人提交代码行数 git log --format='%aN' | sort -u | while read name; do echo -en "$name\t" ...
- git更改已提交作者用户名
git更改已提交作者用户名 官网地址 配置作者用户名 为当前本地库单独配置作者信息 git config -f .git/config user.name "name" git c ...
- git log 查看提交记录,参数:
git log 查看提交记录,参数: -n (n是一个正整数),查看最近n次的提交信息 $ git log -2 查看最近2次的提交历史记录 -- fileName fileName为任意文件名,查看 ...
- git 修改历史提交信息
当你不小心,写错了提交的注视/信息,该如何处理呢.理论上,SCM是不应该修改历史的信息的,提交的注释也是. 不过在git中,其commit提供了一个--amend参数,可以修改最后一次提交的信息 ...
最新文章
- 数据民工,也能移动办公了:目标检测标注App上线Google Play,分分钟创建私人数据集...
- linux存储--共享内存机制mmap(十二)
- win10 本地升级和系统覆盖更新教程
- 20201028 《计算感知》第4节课 笔记
- 前台分页,感觉一般还能优化
- postman电脑版无法安装_CPU使用率高达100%?试试安装Win10 2004版,旧电脑也能运行如飞...
- Softmax分类函数
- LinkedIn领英帐号被封(被限制登录)的解决办法
- 日本盗版漫画网站的罪与罚
- 前端开发:报错Error in created hook:”SyntaxError:Unexpected token u in JSON at position 0”…解决方法
- 图形化生物软件专题(4):MEGAN
- Linux系统 logrotate 详解
- 【C语言】求两个数的最大公约数
- 怎样共享苹果Mac上的 Wi-Fi 密码?
- VC++6.0 MFC显示模态对话框和非模态对话框
- 精通Apache Flink读书笔记
- zk4元年拆解_耐克ZK5 Protro 科五复刻“减配”?可能你根本不懂曼巴心意!
- Google新闻vs门户新闻:决裂还是共存
- AI Earth ——开发者模式案例8:利用Landsat-8数据进行地表温度反演
- SDK数据采集具备的条件是什么?
热门文章
- 置顶信息(不仅修改数据库,也完成了前台效果)
- Unity Editor 编辑器拓展 11——SerializedProperty 和 SerializedObject 的使用
- Linux与Shell学习15--操作命令12--网络/进程相关命令
- struts2+Jquery+Json异步提交(传递复杂JSON对象)
- html可以做题的app,开始答题.html
- 如何使用git(同一账号)在多台电脑协同做工
- 前端基础-浏览器缓存/HTTP缓存机制(面试常考)
- linux 磁盘挂载故障,LVM讲解和磁盘挂载故障
- 关于无障碍,我们都想错了什么?
- 百家号选了综合领域怎么修改?百家号领域错了怎么办?