Donnerstag, 3. Dezember 2009

How to use private svn repo with public (and actual git repository)

If you want to use a svn repository for storing your changes, but the code base is on git this is my way of doing so:

1.: Get the git repo:
git clone git://path/to/git/repo.git/

2.: Add the svn remote information to git: (.git/config)
[svn-remote "repository"]
url = http://path/to/svn/repo/
fetch = :refs/remotes/repository

3.: Fetch the svn source:
git svn fetch repository

4.: Checkout that svn branch into a local branch:
git checkout -b local-svn repository

5.:
git-svn rebase

6.: Get merges from master branch:
git merge master

7.: Commit changes:
git-svn dcommit