FASTIMPORT
Description
Imports Git fast-export data into a repository.
Usage
cm fast-import | fi <repspec> <fast-export-file> [--import-marks=<marks_file>] [--export-marks=<marks_file>] [--stats] [--branchseparator=<chr_separator>] [--nodata] [--ignoremissingchangesets] [--mastertomain]
Options
Option / Argument | Description |
---|---|
repspec | The repository into which the data will be imported. It is created if it did not previously exist. (Use 'cm help objectspec' to learn more about rep specs.) |
fast-export-file | The file with the repository data in Git fast-export format. |
--import-marks | The marks file used for incremental imports. This file has been previously exported by '--export-marks'. The changesets described in this file wont be imported because they were already in a previous import. |
--export-marks | The file where the imported changesets will be saved. This file is used in a later fast-import to signal the changesets that have been already imported. |
--stats | Prints some statistics about the import process. |
--branchseparator | Unity VCS uses "/" as default separator in the branch hierarchy. This option allows using char as a hierarchy separator, so main-task-sub would be mapped in Unity VCS as /main/task/sub. |
--nodata | Imports Git fast-export without including the data. This is useful to check if the import will run correctly. |
--ignoremissingchangesets | Any changesets that cannot be imported are discarded and the fast-import operation continues without them. |
--mastertomain | Imports using "main" instead of "master". |
Help
Remarks
- To export a Git repository, use a command such as: git fast-export --all -M --signed-tags=strip --tag-of-filtered-object=drop> ..\git-fast-export.dat The -M option is important to detect moved items.
- The specified repository is created in case it did not exist.
- Incremental import is supported using a marks file that contains the changesets previously imported ('--import-marks' and '--export-marks' files). This means that only the new changesets that were not imported in the previous fast-import will be imported.
Examples
cm fast-import mynewrepo@atenea:8084 repo.fast-export
(Imports the contents exported in the 'repo.fast-export' file into 'mynewrepo' repository on server 'atenea:8084'.)
cm fast-import repo@atenea:8084 repo.fast-export --export-marks=rep.marks
(Imports the contents exported in the 'repo.fast-export' file into 'repo' repository on server 'atenea:8084' and creates a marks file to perform incremental imports later.)
cm fast-import repo@server:8084 repo.fast-export --import-marks=repo.marks --export-marks=repo.marks
(Imports the contents of the 'repo.fast-export' file. Only the new changesets that were not in the marks file are imported. The same marks file is used to save the list of changesets again for the next incremental import.)