如何使用git-svn来检出只是树干而不是分支和标签? [英] How to use git-svn to checkout only trunk and not branches and tags?
问题描述
我正在研究一个有20个模块相互连接的java遗留项目。所以,每个模块都有自己的分支和标签。结构是这样的。
/项目
.svn
- 模块1
.svn
-trunk
-分支
-tag
- 模块2
.svn
- 分支
- 分支
-tag
项目文件夹大约30G,几乎不可能使用 git-svn clone
来检出所有模块,但这是因为它计算了所有分支和标签。
是否有可能只克隆项目只有主干,这样我才能开始在本地进行提交?
克隆单个Subversion目录非常简单,实际上,您克隆哪个目录并不重要。只需不指定任何布局参数,并直接将路径指定给主干:
git svn clone http ://path.to.svn.repo/module1/trunk
克隆一个特定的模块,包括标签和分支等等
normal git svn clone
看起来如下所示:
git svn clone --stdlayout http://path.to.svn.repo/
<$ c
您想要使用的是: $ c> git svn clone --stdlayout http://path.to.svn.repo/module1/
<这将找到干线
,分支
和标记
module1
文件夹的子文件夹,然后克隆它们。I'm working on a java legacy project which has 20 modules connected to each other. So, each module has it's own Branch and Tag. The structure is like this.
/projects .svn - module1 .svn -trunk -branch -tag - module2 .svn -trunk -branch -tag
The projects folder is around 30G which is nearly impossible to use
git-svn clone
to checkout all the modules, but it's because it counts all the branches and tags.Is it possible to just clone the project only trunk so I can start committing locally?
解决方案Edit: I misread the question and answered what I thought you were asking, not what you actually asked.
To clone just the trunk
Cloning a single Subversion directory is easy, and it actually doesn't matter which directory you clone. Just don't specify any of the "layout" arguments, and give the path to the trunk directly:
git svn clone http://path.to.svn.repo/module1/trunk
To clone a specific module, including tags and branches and so forth
A "normal"
git svn clone
would look something like the following:git svn clone --stdlayout http://path.to.svn.repo/
What you want to use instead will be thus:
git svn clone --stdlayout http://path.to.svn.repo/module1/
That will find the
trunk
,branch
andtag
subfolders of themodule1
folder, and clone them for you.这篇关于如何使用git-svn来检出只是树干而不是分支和标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!