{"thread":{"id":"16439","subject":"Best practices for maintaining a subversion mirror?","startedAt":"2008-11-24T10:55:55Z","lastAt":"2008-11-24T15:37:35Z","messageCount":2,"participants":["Oliver Charles","Peter Harris"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"96409","messageId":"5641883d0811240255i21aef729ld202bd5a3211dad9@mail.gmail.com","threadId":"16439","inReplyTo":null,"subject":"Best practices for maintaining a subversion mirror?","fromName":"Oliver Charles","fromEmail":"oliver.g.charles@googlemail.com","sentAt":"2008-11-24T10:55:55Z","receivedAt":"2008-11-24T10:55:55Z","isPatch":false,"sender":{"key":"oliver.g.charles@googlemail.com","avatar":null},"body":"Hi,\n\nI just got myself a new server, and as I'm the major Git-using person\nat my work, I'd like to set a mirror of our Subversion repository up\nto hopefully convert a few more people. At the moment, I've done git\nsvn clone http://svn..., and then git clone --bare to make a --bare\nversion of this clone.\n\nNow that I have this mirror, I have this entry in my crontab to update\nit hourly:\n\n0 * * * * cd /.git && /usr/bin/git --git-dir=. svn fetch &&\n/usr/bin/git update-ref refs/heads/master refs/remotes/git-svn\n\nThis seems to be working nicely as a readonly interface, but when I\nclone this repository (git clone git://foo/repo.git) - served via\ngit-daemon - I can't seem to get svn rebase to work on it, which means\nI can't dcommit my changes back to Subversion.\n\nAm I doing things generally the right way, or am I doing it completely\nwrong? :-) Any tips appreciated!\n\n- Oliver Charles\n"},{"id":"96420","messageId":"eaa105840811240737t37578c8dp77adf5da27ac7e45@mail.gmail.com","threadId":"16439","inReplyTo":"5641883d0811240255i21aef729ld202bd5a3211dad9@mail.gmail.com","subject":"Re: Best practices for maintaining a subversion mirror?","fromName":"Peter Harris","fromEmail":"git@peter.is-a-geek.org","sentAt":"2008-11-24T15:37:35Z","receivedAt":"2008-11-24T15:37:35Z","isPatch":false,"sender":{"key":"git@peter.is-a-geek.org","avatar":null},"body":"On Mon, Nov 24, 2008 at 5:55 AM, Oliver Charles wrote:\n> This seems to be working nicely as a readonly interface, but when I\n> clone this repository (git clone git://foo/repo.git) - served via\n> git-daemon - I can't seem to get svn rebase to work on it, which means\n> I can't dcommit my changes back to Subversion.\n>\n> Am I doing things generally the right way, or am I doing it completely\n> wrong? :-) Any tips appreciated!\n\nFirst, make sure you aren't using the --no-metadata flag. git svn\nrebase needs that metadata to rebuild its index.\n\nSecond, a simple \"git clone\" will not set up the svn remotes; you have\nto do that by hand. This is what I do when I clone my svn mirror:\n\nmkdir project\ncd project\ngit init\ngit remote add origin git://mirror/project\ngit config --add remote.origin.fetch +refs/remotes/*:refs/remotes/*\ngit fetch\ngit svn init -Ttrunk svn://upstream/project\ngit config --add svn-remote.svn.fetch branches/foo:refs/remotes/foo\ngit config --add svn-remote.svn.fetch branches/bar:refs/remotes/bar\ngit reset --hard trunk\ngit svn rebase\n\nOnce you have it nailed down, you can put it into a script so all your\nco-workers don't have to do that by hand too.\n\n(Also, I quickly reset my cron job to run every five minutes; I found\nan hour was way too long for my taste. YMMV, of course)\n\nPeter Harris\n"}]}