[英]git svn only use branches without trunk or tags
I have an SVN repo with a normal trunk/branches/tags layout. 我有一个具有正常行李箱/支路/标签布局的SVN存储库。 For my git I want to ignore the trunk & tags folder.
对于我的git,我想忽略trunk&tags文件夹。 I just want to have the branches as git branches nothing more.
我只想拥有分支,因为git分支仅此而已。
Folders: 资料夹:
/trunk (empty)
/tags (full of stuff I want to ignore)
/branches/folder1
/branches/folder2
I tried simply cloning the svn using 我试着简单地使用克隆svn
git svn clone [REPO] -stdlayout
Unfortunately my client has not commited anything into the trunk so I get the error "refs/remotes/origin/trunk not a valid SHA1" I read that no commit into the trunk results in that error. 不幸的是,我的客户端没有将任何内容提交到主干中,所以我收到错误消息“ refs / remotes / origin / trunk不是有效的SHA1”,我读到没有提交到主干中会导致该错误。
My question is: How can I only use the branches folder1 & folder2 to create a new git with said branches. 我的问题是:如何只使用分支folder1和folder2来创建带有所述分支的新git。
Thanks, Michael 谢谢迈克尔
You obviously don't need --stdlayout
which implies trunk, branches and tags. 您显然不需要
--stdlayout
,这意味着主干,分支和标签。 Instead you could specify explicitly what you would like to be fetched from svn. 相反,您可以明确指定要从svn获取的内容。 Most probably something like this would work for you:
最有可能的事情是这样的:
git svn init http://svn.apache.org/repos/asf/commons/proper/email --branches=branches/*
git svn fetch
first command will create a .git/config
with svn-remote "svn"
section which you can adjust for your needs. 第一个命令将创建一个带有
svn-remote "svn"
部分的.git/config
,您可以根据需要进行调整。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.