我想使用 git-svn 查看 Boost 库,并且只想查看从版本 1.35 开始的主干和标签,即 tags/release/Boost_1_35 及更高版本。我的配置如下:
[svn-remote "svn"]
ignore-paths = ^tags/release/(?i:(?!boost)|[^/]*(?:beta|rc)|boost_(?:0|1_[1-2]|1_3[0-4]))[^/]*/
url = https://svn.boost.org/svn/boost
fetch = trunk:refs/remotes/svn/trunk
tags = tags/release/*:refs/remotes/svn/tags/*
但是, git fetch 仍然会获取大量不相关的标签,例如 svn/tags/version_0-9-10 或 svn/tags/version_0-9-10@44215。我想知道指定忽略路径以实现此效果的正确方法是什么。
顺便说一句:我读过如何使用 git-svn 获取/克隆几个分支? https://stackoverflow.com/questions/1892133/how-do-i-fetch-clone-only-a-few-branches-using-git-svn但听起来不是一个可扩展的解决方案。
我已经设法对某些分支这样做,但由于 svn 中的标签实际上是分支,所以它可能应该是相同的:
使用“-t 标签和 -b 分支”进行 git svn init 后,我将 .git/config 编辑为:
[svn-remote "svn"]
... url, fetch and stuff ...
branches = branches/rel-2.1/*:refs/remotes/svn/branches/rel-2.1/*
branches = branches/rel-2.2/*:refs/remotes/svn/branches/rel-2.2/*
branches = branches/rel-2.3/*:refs/remotes/svn/branches/rel-2.3/*
branches = branches/rel-2.4/*:refs/remotes/svn/branches/rel-2.4/*
branches = branches/rel-2.5/*:refs/remotes/svn/branches/rel-2.5/*
我使用了一个简单的Python代码来生成相关行并将其复制到.git/config:
for x in range(1,6):
print branches = " branches/rel-2.{0}/*:refs/remotes/svn/branches/rel-2.{0}/*".format(x)
不像正则表达式那样可扩展,但这是我能找到的最好的。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)