git-fast-import(1)
git-fast-import(1) Manual Page NAME git-fast-import - Backend for fast Git data importers SYNOPSIS git fast-import [<options>] DESCRIPTION This program is usually not what the end user wants to run directly. Most end users want to use one of the existing frontend programs, which parses a specific type of foreign source and feeds the contents stored there to git fast-import . fast-import reads a mixed command/data stream from standard input and writes one or more packfiles directly into the current repository.
When EOF is received on standard input, fast import writes out updated branch and tag refs, fully updating the current repository with the newly imported data. The fast-import backend itself can import into an empty repository (one that has already been initialized by git init ) or incrementally update an existing populated repository. Whether or not incremental imports are supported from a particular foreign source depends on the frontend program in use.
OPTIONS --force Force updating modified existing branches, even if doing so would cause commits to be lost (as the new commit does not contain the old commit). --quiet Disable the output shown by --stats, making fast-import usually be silent when it is successful. However, if the import stream has directives intended to show user output (e.g. progress directives), the corresponding messages will still be shown. --stats Display some basic statistics about the objects fast-import has created, the packfiles they were stored into, and the memory used by fast-import during this run.
Showing this output is currently the default, but can be disabled with --quiet. --allow-unsafe-features Many command-line options can be provided as part of the fast-import stream itself by using the feature or option commands. However, some of these options are unsafe (e.g., allowing fast-import to access the filesystem outside of the repository). These options are disabled by default, but can be allowed by providing this option on the command line.
This currently impacts the following feature commands: export-marks import-marks-if-exists import-marks rewrite-submodules-from rewrite-submodules-to And the following options: export-pack-edges Only enable this option if you trust the program generating the fast-import stream! This option is enabled automatically for remote-helpers that use the import capability, as they are already trusted to run their own code. --signed-tags= <mode> Specify how to handle signed tags.
Behaves in the same way as the --signed-commits= <mode> below. Like for signed commits, the default mode is verbatim . --signed-commits= <mode> Specify how to handle signed commits. The following <mode>s are supported: verbatim , which is the default, will silently import commit signatures. warn-verbatim will import them, but will display a warning. abort will make this program die when encountering a signed commit. strip will silently make the commits unsigned. warn-strip will make them unsigned, but will display a warning. strip-if-invalid will check signatures and, if they are invalid, will strip them and display a warning.
The validation is performed in the same way as git-verify-commit(1) does it. sign-if-invalid [ = <keyid> ], similar to strip-if-invalid , verifies commit signatures and replaces invalid signatures with newly created ones. Valid signatures are left unchanged. If <keyid> is provided, that key is used for signing; otherwise the configured default signing key is used. abort-if-invalid will make this program die when encountering a signed commit that is unable to be verified.
Options for Frontends --cat-blob-fd=<fd> Write responses to get-mark , cat-blob , and ls queries to the file descriptor <fd> instead of stdout . Allows progress output intended for the end-user to be separated from other output. --date-format=<fmt> Specify the type of dates the frontend will supply to fast-import within author , committer and tagger commands. See “Date Formats” below for details about which formats are supported, and their syntax. --done Terminate with error if there is no done command at the end of the stream.
This option might be useful for detecting errors that cause the frontend to terminate before it has started to write a stream. Locations of Marks Files --export-marks=<file> Dumps the internal marks table to <file> when complete. Marks are written one per line as :markid SHA-1 . Frontends can use this file to validate imports after they have been completed, or to save the marks table across incremental runs. As <file> is only opened and truncated at checkpoint (or completion) the same path can also be safely given to --import-marks. --import-marks=<file> Before processing any input, load the marks specified in <file>.
The input file must exist, must be readable, and must use the same format as produced by --export-marks. Multiple options may be supplied to import more than one set of marks. If a mark is defined to different values, the last file wins. --import-marks-if-exists=<file> Like --import-marks but instead of erroring out, silently skips the file if it does not exist. --relative-marks --no-relative-marks After specifying --relative-marks the paths specified with --import-marks= and --export-marks= are relative to an internal directory in the current repository.
In git-fast-import this means that the paths are relative to the .git/info/fast-import directory. However, other importers may use a different location. Relative and non-relative marks may be combined by interweaving --(no-)-relative-marks with the --(import|export)-marks= options. Submodule Rewriting --rewrite-submodules-from=<name>:<file> --rewrite-submodules-to=<name>:<file> Rewrite the object IDs for the submodule specified by <name> from the values used in the from <file> to those used in the to <file>.
The from marks should have been created by git fast-export , and the to marks should have been created by git fast-import when importing that same submodule. <name> may be any arbitrary string not containing a colon character, but the same value must be used with both options when specifying corresponding marks. Multiple submodules may be specified with different values for <name>. It is an error not to use these options in corresponding pairs.
These options are primarily useful when converting a repository from one hash algorithm to another; without them, fast-import will fail if it encounters a submodule because it has no way of writing the object ID into the new hash algorithm. Performance and Compression Tuning --active-branches=<n> Maximum number of branches to maintain active at once. See “Memory Utilization” below for details. Default is 5. --big-file-threshold=<n> Maximum size of a blob that fast-import will attempt to create a delta for, expressed in bytes.
The default is 512m (512 MiB). Some importers may wish to lower this on systems with constrained memory. --depth=<n> Maximum delta depth, for blob and tree deltification. Default is 50. --export-pack-edges=<file> After creating a packfile, print a line of data to <file> listing the filename of the packfile and the last commit on each branch that was written to that packfile. This information may be useful after importing projects whose total object set exceeds the 4 GiB packfile limit, as these commits can be used as edge points during calls to git pack-objects . --max-pack-size=<n> Maximum size of each output packfile.
The default is unlimited. fastimport.unpackLimit See git-config(1) PERFORMANCE The design of fast-import allows it to import large projects in a minimum amount of memory usage and processing time. Assuming the frontend is able to keep up with fast-import and feed it a constant stream of data, import times for projects holding 10+ years of history and containing 100,000+ individual commits are generally completed in just 1-2 hours on quite modest hardware (~$2,000 USD in 2007).
Most bottlenecks appear to be in foreign source data access (the
The rest of this page is on the live site.