git fast-export
Administration
Export history as a fast-import text stream
The 'git fast-export' command writes the history of branches as a plain-text stream: every file version (blob) with a mark, and every commit referring to them. The stream can be edited, filtered, or fed to git fast-import (or another version-control system) to rebuild the history — the basis of many migration and history-rewriting tools.
Synopsis
git fast-export [--all] [<rev-list-options>...][ ] optional| or<arg> placeholder... repeatable--flag option
Options
Choosing the Right Option
Moving history
Stream, bundle or clone
| Command | Format |
|---|---|
git fast-export | Readable text stream |
git bundle | Binary pack in one file |
git clone | A full repository |
Examples
One branch
git fast-export main > main.fiThe history of main as text.
Everything
git fast-export --all > repo.fiEvery branch and tag.
Copy a repository
git fast-export --all | (cd ../copy && git fast-import)Rebuild the history elsewhere.
Workflow Examples
1
git fast-export --all > repo.fiExport
2
othertool fast-import < repo.fiMost VCSs read this format
Troubleshooting
Signed commits abort the export
Cause: Signatures cannot be kept in the stream
Add --signed-tags=strip (and --signed-commits=strip on newer Git)
Tips & Pitfalls
Best Practices
- ✓For history rewriting, prefer git filter-repo over hand-editing a stream.
Common Mistakes
- ✗Editing the stream by hand for big rewrites — use git filter-repo, which is built on it.
FAQ
A:
A number like :3 naming a blob or commit in the stream, so later entries can refer to it.