0

We have been using SVN and slowly the developers have been migrating to git-svn. Now we're ready to make the plunge and completely move to git (using gitolite). I am not sure how to migrate our repository into gitolite and maintain history. I don't know if I should try to convert the svn repo directly or use my local git-svn copy and push that.

What's the best approach?

Yehosef
  • 17,987
  • 7
  • 35
  • 56

2 Answers2

1

I'd recommend to use SubGit to translate your Subversion repositories to Git. The following single command should be enough to perform translation:

$ subgit install svn_repos

After that you'll get Git repository in svn_repos/.git or multiple Git repositories in svn_repos/git/ (in case you keep multiple projects in svn_repos).

You may then continue to use SubGit to keep both Subversion and Git access or just uninstall it and use svn_repos as a Git repository only:

$ subgit uninstall svn_repos

Disclaimer: I'm a developer of SubGit.

  • thanks for the suggestion - I hadn't heard of the project. How would I then take that git repo and push it to the gitolite (I'm new to remote git repos - I've been using svn as the repo all the time.) – Yehosef Jan 03 '12 at 17:12
  • @Yehosef SubGit is a new project, so no wonder you hand't yet heard of it. – Alexander Kitaev Jan 03 '12 at 21:05
  • As for pushing: after `subgit install svn_repos` completes translation, `svn_repos` _becomes_ a normal Git repository. So just run `git --git-dir=svn_repos/.git push --all gitolite_repos_url`. – Alexander Kitaev Jan 03 '12 at 21:14
  • This way, however, you'll loose Git/Subversion mirroring feature of SubGit; to keep it you'll need to move translated Git repository as it is to Gitolite (or specify its path in gitolite configuration). I'll check how to do that. – Alexander Kitaev Jan 03 '12 at 21:14
  • It sounds like subgit is just a way to get svn into git. I already have a git copy of svn from using git-svn - so I could just the `git --git-dir=svn_repos/.git push --all gitolite_repos_url` on that to push the history to the remote? Or because the .git from git-svn will be functionally different from the .git from subgit? thanks! – Yehosef Jan 04 '12 at 08:48
  • git-svn and Subgit translation result may differ, but in general Git repository produced by SubGit and that produced by git-svn has no functional differences. – Alexander Kitaev Jan 04 '12 at 12:49
  • update - the command worked to push the git-svn repo to gitserver - thanks! – Yehosef Jan 05 '12 at 12:46
1

As a follow up I've made a short HOWTO blog post on migrating from Svn to Gitolite: see http://blog.subgit.com/from-svn-to-gitolite/