git config:remote.< name> .fetch-是否可以设置例外? [英] git config: remote.<name>.fetch - is it possible to set up exceptions?
问题描述
可以设置诸如fetch = +refs/heads/*:refs/remotes/origin/*
之类的规则来提取与某个glob匹配的所有分支.
It is possible to set up rules like fetch = +refs/heads/*:refs/remotes/origin/*
to fetch all branches matching certain glob.
但是是否可以从列表中排除某些内容?例如,我不想从refs/heads/X/*
获取任何东西,因为它被我们的自动化工具使用,并且经常有很多我不需要看到的小分支.
But is it possible to exclude something from the list? For example, I don't want to fetch anything from refs/heads/X/*
because it is used by our automated tool, and there're often lots of small branches I have no need to see ever.
推荐答案
不幸的是,没有.要排除X/*
,您必须(肯定地)列出所有不是 X/*
.
Unfortunately, no. To exclude X/*
you must list (positively) everything not X/*
.
这取决于您命名裁判/分支的方式,这可能很容易,或者可能会特别困难.您可以使用git ls-remote
和脚本在很大程度上自动化它(使用grep或python代码或其他任何方法,在添加所有其他引用时排除X/*
).
Depending on how you name your refs / branches, this may be easy enough, or may be especially difficult. You could automate it to a large extent using git ls-remote
and a script (use grep, or python code, or whatever, to exclude X/*
while adding every other reference).
这篇关于git config:remote.< name> .fetch-是否可以设置例外?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!