Some of the repositories in the toolchain/ directory on git.linaro.org, are mirrors of upstream projects (but they can also include Linaro changes).

Most of those mirrors come from SVN or bzr repositories.


All the mirroring happen in the directory /srv/mirror.

For SVN repositories

  • Clone the SVN repository via git-svn in a local folder.
  • Clone the local git-svn repository in a separate folder, to create a real git repository that will be used as the push base.
  • Make sure the new git repo from the local-svn folder has the correct remotes configured: the pull URL should be the local git-svn repository, and the push URL should be the path to the local git repositories directory.

In the case of the gcc mirror, for example, these are the remotes configured:

4.7-branch      /srv/mirror/gcc-4_7-branch (fetch)
4.7-branch      /srv/mirror/gcc-4_7-branch (push)
4.8-branch      git://gcc.gnu.org/git/gcc.git (fetch)
4.8-branch      git://gcc.gnu.org/git/gcc.git (push)
linaro-gcc-4_8-branch   /srv/mirror/linaro-gcc-4_8-branch (fetch)
linaro-gcc-4_8-branch   /srv/mirror/linaro-gcc-4_8-branch (push)
origin  git://gcc.gnu.org/git/gcc.git (fetch)
origin  /srv/repositories/toolchain/gcc.git (push)

linaro-gcc-4_8-branch is the remote, on the local file system, pointing to a git-svn cloned repository, that will have this configuration file (found in .git/config):

        repositoryformatversion = 0
        filemode = true
        bare = false
[svn-remote "svn"]
        url = svn://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_8-branch
        fetch = :refs/remotes/git-svn

The first import operation via git-svn has to be called in this way:

git svn clone svn://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_8-branch

Following updates have to be run as:

git svn rebase


To import everything from a SVN repo, like branches and tags, it is necessary to use this command when cloning the repo:

git svn clone -s svn://...

That argument assume a standard SVN repo layout, with branches/ and tags/ directories. If the repo is not standard it is necessary to provide each path on its own:

git svn clone -T trunk -b branched -t tags ...

Once this is done, it might still be necessary to modify some things in the cloned repository. It might be necessary to move some refs in this way:

refs/remotes/tags => refs/tags
refs/remotes => refs/heads
cp -Rf .git/refs/remotes/tags .git/refs/tags/
rm -rf .git/refs/remotes/tags/
cp -Rf .git/refs/remotes/* .git/refs/heads/

rm -Rf .git/refs/remotes/

For BZR repositories

Mostly the same as the SVN approach, it requires the use of git-bzr-ng (it needs to be available in the path).

As before, first clone the bzr repository locally, then clone the git-bzr one into a clear git repository.

To update the git-bzr repository:

git bzr sync

Platform/Systems/ToolchainsMirror (last modified 2014-06-24 17:47:55)