How to push a new git repository to Subversion —11 January 2012
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.
- Create the target location inside the Subversion repository
svn mkdir https://reposerver/path/to/repo/path/to/project
- 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
- Import the empty Subversion history
git svn fetch
- Replay your commits on top of the empty Subversion history
git rebase remotes/git-svn
- Push the commits to Subversion
git svn dcommit