git 安装与使用
在 fish 中自动启动 git-agent 并添加密钥
参考这个 Github 仓库
使用 commitizen 规范 Git 提交说明
全局安装
下载
pnpm install -g commitizen cz-conventional-changelogyarn add -g commitizen cz-conventional-changelognpm install -g commitizen cz-conventional-changelog创建 ~/.czrc 文件,写入以下内容
{ "path": "cz-conventional-changelog" }这时就可以全局使用 git cz 命令来代替 git commit 命令了
项目局部使用
下载 commitizen
pnpm install -D commitizen cz-conventional-changelogyarn add -D commitizen cz-conventional-changelognpm install -D commitizen cz-conventional-changelog配置,打开项目的 package.json 文件,配置如下。
{ "scripts": { "commit": "git-cz", }, "config": { "commitizen": { "path": "node_modules/cz-conventional-changelog" } } }这时就可以使用下面的命令提交了
pnpm commityarn commitnpm run commit
