克隆存储库后,Azure DevOps强制core.hooksPath [英] Azure DevOps force core.hooksPath after clone a repository

查看:155
本文介绍了克隆存储库后,Azure DevOps强制core.hooksPath的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试将客户端git钩子实施到azure devops git存储库中.

我在根目录中添加了一个 .githooks 目录,并实现了一个 pre-commit 钩子.我提交并将所有内容推送到存储库中.

但是诅咒这个钩子只有在我执行了之后才有效

git config core.hooksPath .githooks

克隆存储库后.

问题在这里:是否可以将每个 default git config core.hooksPath 设置为 .githooks ,否则将无法强迫用户使用挂钩.:/

解决方案

问题在这里:是否可以设置git configcore.hooksPath默认为.githooks,否则为不可能强迫用户使用挂钩.:/

对不起,但目前恐怕不可能,因为我知道 Azure Devops 不支持这种行为.我完全理解您的需求,但是 Azure Devops Git Repos Github Repos 中没有您想要的.

当前,您必须让您的成员手动运行 git config core.hooksPath .githooks 命令以启用您的自定义钩子.我们不能避免手动操作,这是因为git hooks被设计为在某些时候触发每个用户(每个用户而不是每个团队)的操作.>

I try to implement client side git hooks to a azure devops git repository.

I added a .githooks directory to the root and implement a pre-commit hook. I commit and push everything to the repository.

But of curse the hook is only active if I execute

git config core.hooksPath .githooks

after cloning the repository.

The question is here: is there a possiblity to set the git config core.hooksPath per default to .githooks otherwise it will be impossible to force a user to use a hook. :/

解决方案

The question is here: is there a possiblity to set the git config core.hooksPath per default to .githooks otherwise it will be impossible to force a user to use a hook. :/

Sorry but I'm afraid it's impossible for now, as I know Azure Devops doesn't support such behavior. I totally understand your needs but what you want is not available in either Azure Devops Git Repos or Github Repos.

Currently you have to make your members run the git config core.hooksPath .githooks command manually to enable your custom hooks. We can't avoid a manual step here cause git hooks is designed to trigger actions at certain points per user instead of per team.

这篇关于克隆存储库后,Azure DevOps强制core.hooksPath的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆