1. git cz报错

情况1:

git cz
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)
? Write a short, imperative tense description of the change (max 94 chars):
 (7) "初始化项目"
? Provide a longer description of the change: (press enter to skip)

? Are there any breaking changes? No
? Does this change affect any open issues? No
npm ERR! Missing script: "test"
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR!   npm run

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Q\AppData\Local\npm-cache\_logs\2022-06-13T07_51_09_639Z-debug.log
husky - pre-commit hook exited with code 1 (error)
git exited with error code 1

C:\Users\Q\Desktop\my-project\myvue3app\my-vue3app>git cz
cz-cli@4.2.4, cz-conventional-changelog@3.3.0

在这里插入图片描述
解决:

添加 package.json的scripts添加 test 命令
  1. 执行commit 报错
git commit -m 'feat: xxx'
error: pathspec 'xxx' did not match any file(s) known to git

在Linux系统中,commit信息使用单引号包括,windows系统,commit信息使用双引号。因此,在git bash中git commit -m ‘提交说明’ 这样是可以的,但是在win命令行中就要使用双引号。

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐