Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Updating a git mirror of an SVN repository

Tags:

git

git-svn

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?

like image 498
David Doria Avatar asked Jun 04 '12 19:06

David Doria


1 Answers

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
like image 129
robocoder Avatar answered Sep 28 '22 02:09

robocoder