Does subgit support multiple 'branches' directories?

心不动则不痛 提交于 2019-12-19 09:16:12

问题


Does subgit support multiple 'branches' directories?

For example, if one had an SVN repo that went like:

trunk/...
branches/<branch>/...
releases/<release>/...
tags/<tag>/...

but "releases" was really just release branches.

We would want both "branches/" and "releases/" in SVN to become branches in Git.

And if a new branch was created in Git, then in SVN we would want a new directory in "branches/" (i.e. "releases/" is deprecated).

So what we want is multiple branch mappings, but with with one of them being the "primary" one.


回答1:


Yes, since version 2.0 you can specify 'branches' option in SubGit config several times. There's a restriction: left and right parts of the patterns should not intersect or be the same (otherwise the rules become ambiguous):

trunk = trunk:refs/heads/master
branches = branches/*:refs/heads/*
branches = releases/*:refs/heads/releases/*
shelves = shelves/*:refs/shelves/*
tags = tags/*:refs/tags/*

You can't map releases/* and branches/* to refs/heads/* simultaneously, because this makes rules ambiguous (in this case SubGit doesn't know, whether to map refs/heads/branch to branches/branch or to releases/branch).



来源:https://stackoverflow.com/questions/19219978/does-subgit-support-multiple-branches-directories

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