Sometimes you start to work on a new project in git, and sometimes you might have to push it to a Subversion repository. Luckily you can do that, and not just in the dumb way of a single export with no history, but with preserving the history by replaying each of your commits in git to Subversion.

  1. Create the target location inside the Subversion repository
svn mkdir https://reposerver/path/to/repo/path/to/project
  1. Edit your git repository configuration to make the connection with git-svn
[svn-remote "svn"]
  url = https://reposerver/path/to/repo/path/to/project
  fetch = :refs/remotes/git-svn
  1. Import the empty Subversion history
git svn fetch
  1. Replay your commits on top of the empty Subversion history
git rebase remotes/git-svn
  1. Push the commits to Subversion
git svn dcommit

blog comments powered by Disqus