【发布时间】:2019-09-28 01:48:29
【问题描述】:
我将husky 和git-branch-is 用于git 挂钩。在我的 package.json 下方
{
"scripts": {
"test": "jest",
...
},
"husky": {
"hooks": {
"pre-commit": "git-branch-is master && npm test",
"pre-push": "git-branch-is master && npm test"
}
}
从分支提交时使用此选项 feature/802 我重新筛选以下错误
Error: Current branch is "feature/802", not "master".
问题
- 如何禁用以 "feature" 开头的分支的 git 挂钩
- 仅对 master 和 develop 分支应用挂钩。
- 不使用 bash 脚本可以实现吗?
【问题讨论】:
标签: git npm git-branch package.json husky