Herramienta que convierte repositorios SVN completos a Git usando el formato fast-import. Su rasgo distintivo es que se configura mediante un archivo de reglas declarativo, lo que le da un control muy fino sobre cómo se mapean los directorios SVN a ramas y tags de Git. No se le pasan opciones por línea de comandos para el mapeo, se escribe un fichero de reglas y se invoca.
Para un layout SVN estándar: trunk/, branches/, tags/:
$ cd ~/project/
$ nano reglas.rules
create repository mi-proyecto.git
end repository
match /trunk/
repository mi-proyecto.git
branch master
match /branches/([^/]+)/
repository mi-proyecto.git
branch \1
match /tags/([^/]+)/
repository mi-proyecto.git
branch \1
substitute branch /refs/tags/\1
Con un proyecto de layout no estándar: todo en la raíz, sin trunk:
$ nano reglas.rules
create repository app.git
end repository
match /
repository app.git
branch master
Ejemplo de autores.txt:
$ nano autores.txt
jdoe = Juan Doe <jdoe@empresa.com>
mgarcia = María García <mgarcia@empresa.com>
Para dividir un solo repositorio SVN en varios repos Git:
$ nano reglas.rules
create repository libfoo.git
end repository
match /libfoo/
repository libfoo.git
branch master
prefix /
$ svn-all-fast-export --identity-file=autores.txt --stats --rules=reglas.rules ~/project/repositorio.svn
1.-
Ejemplo completo de sesión:
$ cd project
$ git init --bare project.git
$ svn-all-fast-export --identity-file=autores.txt --rules=reglas.rules --svn-branches --empty-dirs /srv/svn/project
$ git log --oneline --graph --all | head