开发者

How to mirror a GitHub SVN repository to SVN Repository hosted in other place

Scenario:

I have a Git Repo hosted in GitHub: https://Nerian@github.com/Nerian/JPovray.git

Which can be accessed by SVN clients at: http://svn.github.com/Nerian/JPovray.git

And I have another SVN server hosted in school servers. I want this server to be a mirror from the repo at GitHub.

It is a school requirement to use the SVN repo at school.

Test:

#Create the mirror repo
svnadmin create dest

#Make the hooks always pass
echo "#!/bin/sh" > dest/hooks/pre-revprop-change
echo "#!/bin/sh" > dest/hooks/start-commit    

#Make the hooks executable
开发者_Go百科chmod +x dest/hooks/pre-revprop-change dest/hooks/start-commit

#Initialize the mirror repo to mirror the github repo
svnsync init file://`pwd`/dest http://svn.github.com/Nerian/JPovray.git 

It gives me this message :

svnsync: Storage of non-regular property 'svn:wc:ra_dav:version-url' is disallowed through the repository interface, and could indicate a bug in your client

#Start the mirroring process 
svnsync sync file://`pwd`/dest

It gives me this message:

svnsync: REPORT of 'http://svn.github.com/Nerian/JPovray.git': 200 OK (http://svn.github.com)

#Checkout the mirror repo.
svn checkout file://`pwd`/dest client

It gives me the message:

Checked out revision 0.

Currently, there are 6 revisions on the Github repo. The checkout say there are 0. So it means the sync didn't work. The client repo is empty, while the Github repo has 2 two files.

Constrains:

It is possible to run commands in the SVN repo at school, I just have to contact the SVN manager.

The commit history of the GitHub repo must be keep. We are a team of 3 members and the professor needs to know who commit what.

EDIT:

I contacted GitHub about this, and they told that it is not possible to mirror a GitHub svn repo because they are not really subversion repos. It's just some sort of bridge.

So I have started programming a solution:

https://github.com/Nerian/github_subversion_converter

This Ruby application will allow transferring commits from one SVN to another one. Currently, as of 23 october 2010 it do its job. But doesn't preserve Commit Author name. I am working in that. Should be feature complete in a week. For the current status, check the repo page.


Pure Git with git-svn may be more practical way (for manual mirroring):

  • Github repo acessed as git-repo
  • SVN repo is just additional remote with git-svn
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜