Reputation: 69
I have a project developing using GIT. I need to make a SVN mirror only repository for users that didn't like GIT. I googled some instructions about it but all of them failed. Part of them written for Linux - I have Windows. Part of them suggest to create empty repository and then syncing it with main GIT repository - it's not really what I want. Part of them simple didn't work failing on different stages with cryptic messages. So I decided to ask here. I digged into git-svn command description in desperate attempt to make this thing work by myself. I'm failed too. Github svn export too unstable to rely on it. Now I'm asking you to help.
So, here the task.
Is it possible to make this thing really work?
Upvotes: 4
Views: 1109
Reputation: 2999
I think SubGit is the way to go.
The problem is that SubGit installs its own hooks right into Subversion and Git repositories. So, I doubt it's possible to setup that for hosting provider, like sourceforge or google code.
If you create your own Subversion repository, it's not a big deal to setup even read-write mirror with SubGit:
Create Subversion repository:
$ svnadmin create $SVN_REPO
Clone Git repository:
$ git clone --mirror $GIT_REMOTE_REPO $GIT_REPO
Configure SubGit:
$ subgit configure $SVN_REPO
Adjust SubGit configuration file:
# Specify 'git.default.repository = $GIT_REPO'
# at $SVN_REPO/conf/subgit.conf
Add authors mapping:
# Add all the authors as
# svnauthor = Git Author <[email protected]>
# into $SVN_REPO/conf/authors.txt
Install SubGit into Subversion repository:
subgit install $SVN_REPO
After installation is finished, you can clone $GIT_REPO as another remote and push to this repository to get all the commits converted into Subversion repository.
One may commit changes into Subversion repository, SubGit converts them automatically into Git commits, so you may fetch them back.
SubGit is a commercial project but it's free for open-source projects. For more details please refer to SubGit documenation and git-svn comparison.
Upvotes: 1
Reputation: 1713
git svn init
or git svn clone
are intended to connect to an existing SVN repo, so I'd suggest the following.
svn git clone
git svn dcommit
of the branch you want to share with the SVN repoAnother completely different approach is to use git and SVN on the same work files. You only have to make sure to ignore the .git and .svn dirs respectively. Then you use git commands for git and SVN commands for SVN.
Of course, with this approach you have to sync every commit manually you want to have in both repos, but if you don't care to have all commits in both repos this might be sufficient.
Upvotes: 0