问题
I'm trying to convert my svn repo to git, but I'm not having much success. 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
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.
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/*'
回答1:
Just remove --stdlayout
option. It means trunk/branches/tags structure.
回答2:
If you have local access to your SVN repository, I would recommend you to use SubGit for conversion. 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. 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. 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).
None of those solutions is based on "git-svn".
来源:https://stackoverflow.com/questions/11159711/unable-to-convert-svn-repository-without-trunk-to-git