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

Bryan Berry bryan at olenepal.org
Sat Mar 13 02:25:39 EST 2010


Bernie,

your solution would mean we would have to create each new repo in two
places, one on g.o.o and another on g.sl.o . Is this understanding
incorrect?

Since we have 80+ lessons currently and each lesson requires its own
repo, this will mean a lot of admin time. In the future we should have
more than a couple hundred lessons, which will cause even more admin
head aches

Is there any way we could automatically export new repos from g.o.o to g.sl.o?

On Wed, Mar 10, 2010 at 5:18 PM, Bernie Innocenti <bernie at codewiz.org> wrote:
> 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