LinuxCommandLibrary

git-fast-export

Export Git history in fast-import stream format

TLDR

Export repository to stream

$ git fast-export --all > [repo.txt]
copy
Export specific branch
$ git fast-export [branch] > [branch.txt]
copy
Export with blobs
$ git fast-export --all --signed-tags=strip > [export.txt]
copy
Export for reimport
$ git fast-export --all | git fast-import
copy

SYNOPSIS

git fast-export [options] [revs]

DESCRIPTION

git fast-export generates a complete textual representation of Git repository history in a format designed for consumption by git fast-import. This creates a portable, version-control-system-agnostic representation of commits, trees, tags, and their relationships.
The primary use case is repository migration and transformation. Export streams can be filtered, modified, or split before reimport, enabling powerful repository restructuring operations such as extracting subdirectories, rewriting author information, or converting between Git hosting providers.
The export format is line-oriented and human-readable. Combined with git fast-import, this command pair provides significantly faster repository operations than git filter-branch for large-scale history rewrites. The --anonymize option supports sharing repository structure for debugging while protecting sensitive content.

PARAMETERS

--all

Export all refs.
--signed-tags mode
Handle signed tags (warn, strip, verbatim).
--tag-of-filtered-object mode
Handle filtered tags.
--no-data
Skip blob contents.
--anonymize
Anonymize data.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community