Search code examples
gitgit-svn

Updating a git mirror of an SVN repository


I created a git mirror of an SVN repository by doing:

  • Create a new repo on github
  • mkdir mirror && cd mirror
  • git svn init [svn url]
  • git svn fetch -rHEAD
  • git remote add origin [github url]
  • git svn rebase
  • git push origin master

This works great, and I can update it with simply:

  • git svn rebase
  • git push origin master

However, if I move to a different computer and want to update it, I tried:

  • git clone [github url]
  • git svn init [svn url]
  • git svn fetch -rHEAD
  • git remote add origin [github url]
  • git svn rebase

but here I get:

"Unable to determine upstream SVN information from working tree history"

Can anyone explain the correct way to do this?


Solution

  • I had the same need and eventually found an example here:

    http://rip747.wordpress.com/2009/06/17/reviving-a-git-svn-clone/

    To answer in the context of your question:

    git clone [github url]
    cd repo
    git svn init [svn url]
    git update-ref refs/remotes/git-svn refs/remotes/origin/master
    git svn rebase