git-fast-export
Export the contents and history of a Git repository in a streamable, plain-text format. tldr-pages
On several platforms
Several platforms
Export the entire Git repository history to stdout
git fast-export --allIdentifyExport the entire repository to a file
git fast-export --all >path/to/fileIdentifyExport a specific branch only
git fast-export mainIdentifyExport with progress statements every n objects (for showing progress during git fast-import)
git fast-export --progress n --all >path/to/fileIdentifyExport only a specific subdirectory's history
git fast-export --all -- path/to/directory >path/to/fileIdentify