我如何从repo服务器上看到克隆的repo的“本地”git分支的名称?我有8-10个开发人员,我想确保他们在本地机器上使用分支命名标准。这有可能吗?
发布于 2015-09-11 14:43:06
这就是我在“Definition of “downstream” and “upstream””中所解释的:
的DVCS (分布式版本控制系统)的扭曲是:你不知道下游实际上是什么,除了你自己的repo相对于你已经声明的远程repos。
您看不到下游回购及其分支:它们可以看到您。而不是相反。
您可以做的是设置一个pre-receive hook,它将强制执行分支命名策略,并拒绝对不匹配该策略的分支的任何推送。
有关实例this hook,请参阅
# if this is a branch with a prefixed name...
if echo $ref | grep -q "^refs/heads/.*-" ; then
...
else # branch does not have a prefix on the form 'prefix-*'
echo "$ref is not a valid branch name. Please consult the naming conventions."
exit 1;
fihttps://stackoverflow.com/questions/32506656
复制相似问题