How to git svn fetch only branches/tags with certain patterns?

我的梦境 提交于 2019-12-04 15:43:15

I have managed to do so for certain branches, but since tags in svn are actually branches it should probably be the same:

After git svn init with "-t tags and -b branches" I have edited .git/config to be:

[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/*

I used a simple python code to generate the relevant lines and copied it to .git/config:

for x in range(1,6):
   print branches = "     branches/rel-2.{0}/*:refs/remotes/svn/branches/rel-2.{0}/*".format(x)

Not as scalable as regex, but that's the best I could find.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!