在.git/hooks文件夹中配置脚本,可以实现在commit或者push前运行脚本的功能
但是根据提示配置后一直不生效,检查后发现是windows在配置hooks文件夹的时候需要加上.git
// 配置hooks
git config --local core.hooksPath .git/hooks
查看.git文件夹中的config文件,可以看到hooksPath = .git/hooks
再次运行命令,可以看到脚本生效
在.git/hooks文件夹中配置脚本,可以实现在commit或者push前运行脚本的功能
但是根据提示配置后一直不生效,检查后发现是windows在配置hooks文件夹的时候需要加上.git
// 配置hooks
git config --local core.hooksPath .git/hooks
查看.git文件夹中的config文件,可以看到hooksPath = .git/hooks
再次运行命令,可以看到脚本生效