git fast-import
Build a repository from a fast-import stream
The 'git fast-import' command reads a text stream of blobs and commits (as written by git fast-export or by migration tools for other version-control systems) and writes them into the repository at high speed. It is the engine behind most imports into Git.
Synopsis
git fast-import [<options>] < <stream>Examples
Import a stream
git fast-import < repo.fiRebuild the history in this repository.
Copy a repository
git fast-export --all | (cd ../copy && git fast-import)Export here, import there.
Workflow Examples
git fast-export --all > repo.fiExport
edit repo.fi with a scriptTransform
git fast-import < repo.fiImport into a fresh repository
Troubleshooting
fatal: Unsupported command
Cause: The stream is malformed
Check the line the error names; the format is strict
Tips & Pitfalls
Best Practices
- ✓Import into a new, empty repository.
FAQ
Mostly — and for tools like git filter-repo that rewrite history through it.