简体   繁体   English

无法将svn存储库(没有trunk)转换为git

[英]Unable to convert svn repository (without trunk) to git

I'm trying to convert my svn repo to git, but I'm not having much success. 我正在尝试将我的svn repo转换为git,但我没有取得多大成功。 The repository in question does not have anything like a "trunk". 有问题的存储库没有像“主干”那样的东西。 The layout is the following: 布局如下:

/home/svn/
      |--- /project1/
      |--- /project2/
      |--- /repos/project3/

And underneath those project folders are the files. 这些项目文件夹下面是文件。 No trunk, no branches, no nothing special. 没有树干,没有树枝,没有什么特别的。 At the time that was all I needed, and now it's biting me in the ass. 当时我需要的只是,现在它正在咬我的屁股。

I'm following this guide: http://john.albin.net/git/convert-subversion-to-git 我正在遵循这个指南: http//john.albin.net/git/convert-subversion-to-git

When I run this command: 当我运行此命令时:

git svn clone svn+ssh://skerit@host.com/home/svn/repos/kiflea --no-metadata -A authors-transform.txt --stdlayout ~/kiflea

It says it has created an empty git repository... But I don't really want it to be empty. 它说它已经创建了一个空的git存储库...但我真的不希望它是空的。

I also have no idea what the following commands should look like, since my repository has a different layout. 我也不知道以下命令应该是什么样子,因为我的存储库有不同的布局。

Commands like git symbolic-ref HEAD refs/heads/trunk or git config remote.bare.push 'refs/remotes/*:refs/heads/*' 命令如git symbolic-ref HEAD refs/heads/trunkgit config remote.bare.push 'refs/remotes/*:refs/heads/*'

Just remove --stdlayout option. 只需删除--stdlayout选项即可。 It means trunk/branches/tags structure. 它表示主干/分支/标签结构。

If you have local access to your SVN repository, I would recommend you to use SubGit for conversion. 如果您可以本地访问SVN存储库,我建议您使用SubGit进行转换。 There're a few simple steps: 有几个简单的步骤:

$ subgit configure path/to/svn/repository
$ #edit path/to/svn/repository/conf/subgit.conf to specify "core.authorsFile" option to point to your authors-transform.txt
$ subgit install path/to/svn/repository

After that a Git repository will be created and the repositories will be in constant sync. 之后,将创建一个Git存储库,并且存储库将保持不变同步。 Optionally you may run 您可以选择运行

$ subgit uninstall path/to/svn/repository

to turn synchronization off. 关闭同步。

If you have no local access to your repository, you clone your repository with SmartGit . 如果您没有对存储库的本地访问权限,则使用SmartGit克隆存储库。 The effect will similar to "git svn clone" but such SVN concepts like ignores, EOLs-processing options, tags will be also translated to Git (the same I can say about SubGit too). 效果类似于“git svn clone”,但像ignores,EOLs处理选项,标签这样的SVN概念也将被翻译成Git(我也可以说SubGit也是如此)。

None of those solutions is based on "git-svn". 这些解决方案都不是基于“git-svn”。

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

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