git-fast-export
Export Git repository data
SYNOPSIS
git fast-export [options] git-rev-list-args
PARAMETERS
--all
Export all refs found in the 'refs/' hierarchy.
--branches[=
Export all branches, or only those matching a specified pattern.
--tags[=
Export all tags, or only those matching a specified pattern.
--full-history
Ensures all history reachable from the selected commits is exported.
--root-commits
Only export root commits for the selected history, without their parents.
--date-format=
Specify the date format for commit export, e.g., 'raw' or 'iso8601'.
--import-marks=
Read marks from the specified file to enable incremental imports.
--export-marks=
Write marks to the specified file for subsequent incremental exports.
--mark-tags
Mark tags in the export output for proper reconstruction during import.
--no-data
Do not export blob contents; useful for structure-only analysis or dry runs.
--depth=
Limit the export to the last N commits of reachable history.
--since=
Export only commits newer than the specified date.
--until=
Export only commits older than the specified date.
--max-pack-size=
Limit the size of pack files generated by the output to N bytes.
--max-blob-size=
Limit the size of individual blobs exported to N bytes.
--reencode-meta
Re-encode commit metadata (author/committer) to UTF-8 if necessary.
DESCRIPTION
git-fast-export is a Git porcelain command used to output Git repository history in a format suitable for git-fast-import. This streaming format allows for efficient transfer of Git objects (blobs, trees, commits, and tags) and references. It's primarily designed for repository migrations, enabling the conversion of other version control systems' histories into Git, or for exporting a subset of a Git repository's history to another Git repository. The command processes history specified by arguments similar to git rev-list, generating a sequence of fast-import commands that reconstruct the history. Unlike git-bundle, which creates a self-contained archive, git-fast-export produces a stream, making it ideal for piping data directly or processing large repositories incrementally. It's a powerful tool for complex history manipulation and data transfer between Git instances.
CAVEATS
The output format is highly specific to git-fast-import and not intended for direct human consumption.
Processing very large repositories can generate extremely large output files, requiring significant disk space and memory.
Correctly handling history rewrites or complex merges often requires a deep understanding of Git's object model and can be challenging.
MARKS FILES
Marks files (--import-marks, --export-marks) are crucial for incremental exports and imports. They map original Git object IDs to new, sequentially generated IDs, allowing git-fast-import to continue processing from a known state without re-importing already processed objects. This is vital for resuming failed imports or periodically synchronizing repositories.
OUTPUT FORMAT OVERVIEW
The command generates a series of text-based commands that describe Git objects and references. Key commands include blob (for file contents), commit (for commit metadata and tree states), tag (for annotated tags), reset (to set a branch/ref), and alias. Each command details the object's type, content, and relationship within the Git graph, making it a programmatic representation of a repository's history.
HISTORY
git-fast-export was developed as a core component of Git's design philosophy, enabling efficient and flexible data exchange. Its inception parallels that of git-fast-import, providing a robust mechanism for migrating histories from various version control systems into Git. This stream-based approach ensures scalability for large repositories and facilitates integration with other tools for history manipulation. It has been a stable and crucial utility since its early days, evolving with Git to support new features while maintaining its core functionality.
SEE ALSO
git-fast-import(1), git-rev-list(1), git-bundle(1), git-filter-repo(1), git-filter-branch(1)