レナート   TBFKAYIBYNYAAYB   ﻟﻴﻨﺎﺭﺕ

Thu, 03 Jan 2008

GIT Mirrors of my SVN Repositories

To whom it may concern: as a first step to move away from SVN and towards GIT for all my code, I have now configured live GIT mirrors for all my SVN repositories. The plan is to move fully to GIT, but not as long as the GIT integration into Trac is as painful as it is right now. The scripts I used to initialize and update the mirrors are svn-live-init and svn-live-update, for those interested. They are based on scripts CJ van den Berg supplied me with.

It would be great to have the mirror to be both ways. Lazyweb, do you know how to do that?

posted at: 15:12 | path: /projects | permanent link to this entry | 7 comments


Posted by Diego Flameeyes Pettenò at Thu Jan 3 15:35:07 2008
Seems like you didn't chmod +x the post-update script for publishing the repositories with HTTP :)

Initialized empty Git repository in /home/flame/devel/repos/anon/libasyncns/.git/
Cannot get remote repository information.
Perhaps git-update-server-info needs to be run there?

And if you can put git-daemon, that would be quite faster ;)

Posted by Lennart at Thu Jan 3 15:48:10 2008
Hmm, works fine here:

git clone http://git.0pointer.de/repos/libasyncns.git/

What line did you use? My HTTP logs don't show any access on the repository. Are you sure you used the right URL?

git-update-server is run explicitly from the update script, so running it from the hook is not strictly necessary.

Posted by Steven Walter at Thu Jan 3 22:40:24 2008
What is the purpose of the second git repository (the one not in svn-import).  Why can't git clients simply fetch directly from the git-svn repository?

I'm using a similar setup for work, where the canonical repositories are subversion, but several people prefer git and so use the "cached repositories," (as I call them).  I have a simple script that sets up git-svn in each leaf repository, so individual contributors fetch by git but "push" directly to subversion.

Posted by Lennart at Thu Jan 3 22:46:16 2008
Stevent: Quiting CJ van den Berg who wrote the scripts mine are based on:

<quote>

You can't/shouldn't publish the original repository created by "git svn clone" for three reasons.

1.) It's not a 'bare' repository. You shouldn't really ever publish a git repository that has a working tree (ie.  non-bare).

2.) It has a useless local 'master' branch. This branch is meaningless to the world and you don't really want to publish junk. If you delete it though you'll break "git svn fetch" IIRC. And most importantly

3.) It has all the branches found in svn listed as 'remote' branches, which means they won't get cloned by default and that would make the whole
exercise pretty pointless.

The mirror clone of the "git svn clone" repo is a.) bare, b.) has no junk master branch, and c.) is specially configured to transform the 'remote'
branches created by svn clone into regular local branches so cloning it will work just as expected.

</quote>

Posted by Lennart at Thu Jan 3 22:47:06 2008
Bah

s/Stevent/Steven/

s/Quiting/Quoting/

Posted by Ted Percival at Thu Jan 10 09:28:43 2008
Excellent. I look forward to the main repositories being switched to Git to fully take advantage of its features.

Posted by Brett Neumeier at Tue Jul 20 17:22:49 2010
FYI, I get 403 Forbidden for http://0pointer.de/public/svn-live-init and http://0pointer.de/public/svn-live-update

Leave a Comment:

Your Name:


Your E-mail (optional):


Comment:


As a protection against comment spam, please type the following number into the field on the right:
Secret Number Image

Please note that this is neither a support forum nor a bug tracker! Support questions or bug reports posted here will be ignored and not responded to!


It should be obvious but in case it isn't: the opinions reflected here are my own. They are not the views of my employer, or Ronald McDonald, or anyone else.

Please note that I take the liberty to delete any comments posted here that I deem inappropriate, off-topic, or insulting. And I excercise this liberty quite agressively. So yes, if you comment here, I might censor you. If you don't want to be censored your are welcome to comment on your own blog instead.


Lennart Poettering <mzoybt (at) 0pointer (dot) net>
Syndicated on Planet GNOME, Planet Fedora, planet.freedesktop.org, Planet Debian Upstream. feed RSS 0.91, RSS 2.0
Archives: 2005, 2006, 2007, 2008, 2009, 2010

Valid XHTML 1.0 Strict!   Valid CSS!