Tuesday, January 16, 2007

Importing Python Subversion Archive into Git

While it is not well advertised, it is possible to download a snapshot of the Python Subversion repository via rsync.
rsync -avP svn.python.org::ftp/pub/svn.python.org/snapshots/projects-svn-tarball.tar.bz2 .
Note: I discovered later that it can be downloaded by browser as well, http://svn.python.org/snapshots.

Once the file is downloaded expand it:
bunzip2 projects-svn-tarballs.tar.bz2|tar xf -
Then use git-svnimport to create the baseline git repository:
git-svnimport -v -C python.git -T python/trunk -t python/tags -b python/branches file://`pwd`/projects
Following this the archive may be brought up to date and kept upto date using:
git-svnimport -v -C python.git -T python/trunk -t python/tags -b python/branches http://svn.python.org/projects

No comments: