[Systems] need help synchronizing git.olenepal.org with git.sugarlabs.org

Bernie Innocenti bernie at codewiz.org
Wed Mar 10 06:33:38 EST 2010


On Wed, 2010-03-10 at 10:49 +0545, Bryan Berry wrote:
> We have set up our own local instance of gitorious because our
> bandwidth to the US sucks. We still need a way to synchronize our work
> done on the local instance http://git.olenepal.org  w/ g.sl.o
> 
> How can we make this happen?

You could write a cron job that would cd to the dir where all the git
repositories are, and then do something as simple as:

  for repo in */*.git; do
      export GIT_DIR="$repo"
      git push --mirror --force "gitorious at git.sugarlabs.org:$repo"
  done

Obviously, you'd need to install an ssh key for the user running that
script into some "olesync" account in our Gitorious.

If you have only some repos to sync, just do it this way:

  PROJECTS="foo bar baz"
  for prj in $PROJECTS; do
     for repo in "$prj/*.git"; do
        ...
     done
  done

Ta da'! :-)

The pushes should be very cheap. If they are not, try doing "git gc"
before each push.

-- 
   // Bernie Innocenti - http://codewiz.org/
 \X/  Sugar Labs       - http://sugarlabs.org/



More information about the Systems mailing list