git fast-import

Administración

Construye un repositorio a partir de un flujo fast-import


El comando 'git fast-import' lee un flujo de texto de blobs y commits (como lo escribe git fast-export o las herramientas de migración de otros sistemas) y los escribe en el repositorio a gran velocidad. Es el motor de la mayoría de las importaciones a Git.

Sinopsis

git fast-import [<options>] < <stream>
[ ] opcional| o<arg> valor a sustituir... repetible--flag opción

Ejemplos

Importar un flujo

git fast-import < repo.fi

Reconstruir el historial en este repositorio.


Copiar un repositorio

git fast-export --all | (cd ../copy && git fast-import)

Exportar aquí, importar allí.

Ejemplos de flujos de trabajo

1
git fast-export --all > repo.fi

Exportar

2
edit repo.fi with a script

Transformar

3
git fast-import < repo.fi

Importar en un repositorio nuevo

Solución de problemas

fatal: Unsupported command

Causa: El flujo está mal formado

Revisa la línea que indica el error; el formato es estricto

Consejos y trampas

Buenas prácticas

  • ✓Importa en un repositorio nuevo y vacío.

Preguntas frecuentes

A:

Sobre todo — y para herramientas como git filter-repo que reescriben el historial con él.