Reputation: 46663
There's an SVN open-source project which I have read-only access to, and I'd like to create a GIT mirror of that project up to date on GitHub.
I know how to set up the initial mirror and then keep it up to date with git svn rebase
, but that still requires having a server set up somewhere with a cron job running to handle the syncing, setting up monitoring to make sure the server is up and the cron job is running, periodically upgrading to the latest git release, etc.
Before I reinvent the same wheel that every other SVN->GIT mirror has had to, I was wondering if there are any services (free or paid) which will automate SVN->GIT mirroring for me. Know of any?
Obviously an automated service can't merge my changes-- all my changes are happening in a separate repo (or perhaps a separate branch in the same repo). I'm just looking for a way to automate the SVN interaction and create an exact mirror that others can clone.
Upvotes: 14
Views: 1479
Reputation: 1609
svn2github.com seems to be exactly what you want. It mirrors any svn repo to github and updates automatically as long as the repo has less than 2000 files (above that you need to update manually)
Upvotes: 0
Reputation: 5129
You should just use tailor. It is able to repeatedly convert about any VCS to any other VCS. And it does it incrementally, meaning that if you first convert your SVN repo to Git, then commits are made to SVN, and you convert again, it will only convert the new revisions, properly adding them as history to the existing Git history.
You could automate the process in two ways: either you just run tailor on a time basis, with something like cron or anacron, or you use, as previously suggested, post-commit hooks in SVN, thus triggering conversion immediately after anything is committed to SVN.
Upvotes: 2
Reputation: 32716
You can use post-commit hooks in svn server to tell git-svn that it's time to rebase.
Upvotes: 5
Reputation: 5166
I think the responsibility for this should fall into the hands of the people maintaining the project. See for instance how Apache support their projects with Git mirrors.
On the other hand, there isn't that much "invention" to do here, I think. If you have a server that can poll continuously to the SVN repository for changes, doing a git-svn rebase and push to github is fairly straight forward. I doubt any companies specialize in setting up this (at least, I haven't seen any).
On a side-note, when you want to share your changes, you ought to not push to the Git-mirror. It's better to either do git-svn dcommit back to SVN, or send a patch to the developers. If you push to the SVN fetching repo, it'll mess up git-svn, I believe. Like you say, bi-directional Git-SVN syncing can't be automated.
Upvotes: 6