简体   繁体   English

git svn只使用没有主干或标签的分支

[英]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.

相关问题 如何使用git-svn只检查主干而不是分支和标签? - How to use git-svn to checkout only trunk and not branches and tags? Svn - > git迁移与几个主干/分支/标签 - Svn -> git migration with several trunk/branches/tags Git与SVN主干和分支机构 - Git with SVN trunk and branches 使用没有trunk标记和分支的SVN存储库从SVN迁移到Git - Migrating from SVN to Git with SVN repository having no trunk tags, and branches 开始跟踪仅跟踪主干的git-svn仓库上的分支/标签 - Start tracking branches/tags on a git-svn repo that was tracking only trunk 从SVN迁移到带有附加文件夹的标签/树干/分支/发行版的GIT - Migrating from SVN to GIT with tags/trunk/branches/release with a extra folder git-svn不承诺分支,只有trunk - git-svn isn't committing to branches, only trunk 设置git-svn存储库,其中svn主干/标签/分支组织在模块子文件夹中 - Setting up git-svn repository where svn trunk/tags/branches are organized in module subfolders 并非总是使用SVN到GIT的主干/分支/标签结构来迁移存储库 - Migrate a repo not always using the trunk/branches/tags structure from SVN to GIT git svn init可以处理trunk / branches / tags的兄弟目录,这些目录应该是base checkout的一部分 - Can git svn init handle sibling directories of trunk/branches/tags that should be part of base checkout
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM