Husky 🐶 woof!
然而,突然之间,一切都改变了...
生活总是不经意之间给你开了个玩笑,而你却无能为力,不知所措...
我要扼住生命的喉咙,我命由我不由天!!!!!!
参考官网:typicode.github.io/husky/#/ 按以下步骤进行设置:
- 删除 .git 目录下的 hooks 及 .husky
-
查看 git config 配置是否存在 core.hookspath=.husky
git config --list
-
删除配置及卸载 Huksy:
npm uninstall husky && git config --unset core.hookspath
-
再次安装 Husky:
npm install husky --save-dev // npm set-script prepare "husky install" npx husky-init
-
新增 Hooks:
npx husky add .husky/pre-commit "npx lint-staged" npx husky add .husky/pre-commit "npx pretty-quick --staged" npx husky add .husky/commit-msg 'npx --no-install commitlint --edit'
-
Git Flow 设置
git config gitflow.path.hooks .husky -
随便改点什么吧,试下 git commit
从此一切又变得那么的美好,生活还是有很多值得向往与期待的 🐶 woof!
推荐一下,又一开源力作,promotion-web,基于React/Webpack/ReactRouter/Fetch 最前沿技术构建的企业级中台项目!!!
Github: github.com/wkylin/prom…
Demo: wkylin.github.io/promotion-w…
不断完善中,欢迎加入,一起成为Contributors !