Nik*_*tic 11 git hook frontend husky
我有与赫斯基一起实施的预推钩.现在我想删除它.
问题是yarn remove huskygit钩子还在里面.git/hooks.
因为我每次想要提交或切换分支或提交时都会收到此错误,因此甚至无法提交 - >
.git/hooks/pre-commit: line 6: node_modules/run-node/run-node: No such file or directory
我知道我总是可以删除里面的每个钩子,.git/hooks但我怎么能远程推送这个更改?如何不让我的队友做同样的事情?
此外,我知道我可以使用-n标志,但我仍然不想这样做,我想干净的git提交.
wot*_*nii 15
假设你没有非哈士奇的钩子,你可能想要保持:
rm -f .git/hooks/*
Run Code Online (Sandbox Code Playgroud)
内部文件".git/hooks /"是git-hook或被git忽略.通过删除内部的所有内容,您将摆脱所有挂钩,并恢复默认行为.
默认情况下,有一些示例挂钩,但除了作为示例它们没有用处,因此您可以删除它们.
Ren*_*art 10
我认为最好将所有* .sample保留在.git / hooks中
删除那些讨厌的git钩子:
cd .git/hooks
Run Code Online (Sandbox Code Playgroud)
ls | grep \.sample -v | xargs rm
Run Code Online (Sandbox Code Playgroud)
小智 10
Husky文档建议这样做:
npm uninstall husky && git config --unset core.hooksPath
Run Code Online (Sandbox Code Playgroud)
或者
yarn remove husky && git config --unset core.hooksPath
Run Code Online (Sandbox Code Playgroud)