Git-svn is a wonderful tool if you need to access an svn repo. Reading the docs, it discusses how slow the initial clone is and that you should do one clone, check it into git, and have others clone from you. I tried this, doing the following:


$ git svn clone svn://some/project
$ git push git+ssh://mygit.repo

All was good. I then attempted to clone this, and I saw the following:


$ git clone git+ssh://mygit.repo
$ git svn init svn://some/project
$ git svn rebase
Unable to determine upstream SVN information from working tree history

And worse then this, if I did a git-svn fetch it pulled down the entire repo again (4 hours). I am trying to find where in the code the issue is, but here is the workaroung. You need to add one file into the .git repo which points to the current commit’s hash.


# clone the git repo
$ git clone git+ssh://mygit.repo

# Attach it to the svn repo:
$ git svn init svn://some/project

# get the latest commit hash
$ cd mygit.repo
$ git log

# The latest hash will bet the first thing you see (commit [HASH])
# Copy it, and add it as a single line to the git-svn file
$ vi .git/refs/remotes/git-svn

# Now you can fetch the latest from subversion, and begin working
$ git svn fetch
$ git svn rebase