简体   繁体   English

git-svn,如何在trunk中使用目录作为本地trunk

[英]git-svn, how to use a directory in trunk as local trunk

i'm inheriting a codebase that has a lot of directories in trunk that really should live in separate repos. 我正在继承一个代码库,它在trunk中有很多目录,真的应该存在于单独的repos中。 all of my development happens in one specific directory, what should be the only thing in trunk. 我的所有开发都发生在一个特定的目录中,什么应该是trunk中唯一的东西。

eg: /path/to/repo/trunk/true_trunk 例如:/ path / to / repo / trunk / true_trunk

all the tags and branches in the repo refer exclusively to this 'true_trunk' directory. repo中的所有标记和分支都专门指向此'true_trunk'目录。

problem is: i can't get git-svn to act like this sub directory of trunk is really trunk. 问题是:我不能让git-svn像这个trunk的子目录那样行为真的是trunk。 and as a result my checkouts of trunk populate my working directory with the entire contents of trunk, some dozen or so other unrelated code bases. 因此,我的trunk检查用我的工作目录填充了trunk的全部内容,还有十几个其他不相关的代码库。

is there any way to get git-svn to talk only to this 'true_trunk' directoy? 有什么方法可以让git-svn只与这个'true_trunk'能线说话?

any attempt at specifying this directory yields the following out: Using higher level of URL: svn://path/to/trunk/true_trunk => svn://path/to/repo 任何指定此目录的尝试都会产生以下结果:使用更高级别的URL:svn:// path / to / trunk / true_trunk => svn:// path / to / repo

The -T option to git svn init allows you to specify a directory that it will treat as the "trunk" directory. git svn init-T选项允许您指定它将被视为“trunk”目录的目录。 I've used this in the past with oddly arranged Subversion directory trees and it has been successful. 我过去曾使用过奇怪排列的Subversion目录树,但它已经成功了。 You may have to experiment a bit to get the right combination of options for your situation. 您可能需要进行一些实验以获得适合您情况的正确选项组合。

You can specify the your true trunk with the -T option to git svn clone , also -b for your branches and -t for the tags. 您可以使用-T选项为git svn clone指定真正的主干,为分支指定-b ,为标记指定-t I think for this layout you may need to specify each branch / tag separately, something like this should work for you, 我认为对于这种布局,你可能需要分别指定每个分支/标签,这样的东西应该适合你,

$ git-svn clone  \
 -T svn://path/to/trunk/true_trunk \
 -b svn://path/to/branches/branch1/true_trunk  \
 -b svn://path/to/branches/branch1/true_trunk \
 -t svn://path/to/tags/tag1/true_trunk \
 -t svn://path/to/tags/tag2/true_trunk \
repository_name

You may need to generate a dump of your branches and tags from svn to help format this command 您可能需要从svn生成分支和标记的转储以帮助格式化此命令

$ svn ls svn://path/to/tags
$ svn ls svn://path/to/branches

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM