1GIT-FAST-EXPORT(1)                Git Manual                GIT-FAST-EXPORT(1)
2
3
4

NAME

6       git-fast-export - Git data exporter
7

SYNOPSIS

9       git fast-export [<options>] | git fast-import
10

DESCRIPTION

12       This program dumps the given revisions in a form suitable to be piped
13       into git fast-import.
14
15       You can use it as a human-readable bundle replacement (see git-
16       bundle(1)), or as a format that can be edited before being fed to git
17       fast-import in order to do history rewrites (an ability relied on by
18       tools like git filter-repo).
19

OPTIONS

21       --progress=<n>
22           Insert progress statements every <n> objects, to be shown by git
23           fast-import during import.
24
25       --signed-tags=(verbatim|warn|warn-strip|strip|abort)
26           Specify how to handle signed tags. Since any transformation after
27           the export can change the tag names (which can also happen when
28           excluding revisions) the signatures will not match.
29
30           When asking to abort (which is the default), this program will die
31           when encountering a signed tag. With strip, the tags will silently
32           be made unsigned, with warn-strip they will be made unsigned but a
33           warning will be displayed, with verbatim, they will be silently
34           exported and with warn, they will be exported, but you will see a
35           warning.
36
37       --tag-of-filtered-object=(abort|drop|rewrite)
38           Specify how to handle tags whose tagged object is filtered out.
39           Since revisions and files to export can be limited by path, tagged
40           objects may be filtered completely.
41
42           When asking to abort (which is the default), this program will die
43           when encountering such a tag. With drop it will omit such tags from
44           the output. With rewrite, if the tagged object is a commit, it will
45           rewrite the tag to tag an ancestor commit (via parent rewriting;
46           see git-rev-list(1))
47
48       -M, -C
49           Perform move and/or copy detection, as described in the git-diff(1)
50           manual page, and use it to generate rename and copy commands in the
51           output dump.
52
53           Note that earlier versions of this command did not complain and
54           produced incorrect results if you gave these options.
55
56       --export-marks=<file>
57           Dumps the internal marks table to <file> when complete. Marks are
58           written one per line as :markid SHA-1. Only marks for revisions are
59           dumped; marks for blobs are ignored. Backends can use this file to
60           validate imports after they have been completed, or to save the
61           marks table across incremental runs. As <file> is only opened and
62           truncated at completion, the same path can also be safely given to
63           --import-marks. The file will not be written if no new object has
64           been marked/exported.
65
66       --import-marks=<file>
67           Before processing any input, load the marks specified in <file>.
68           The input file must exist, must be readable, and must use the same
69           format as produced by --export-marks.
70
71       --mark-tags
72           In addition to labelling blobs and commits with mark ids, also
73           label tags. This is useful in conjunction with --export-marks and
74           --import-marks, and is also useful (and necessary) for exporting of
75           nested tags. It does not hurt other cases and would be the default,
76           but many fast-import frontends are not prepared to accept tags with
77           mark identifiers.
78
79           Any commits (or tags) that have already been marked will not be
80           exported again. If the backend uses a similar --import-marks file,
81           this allows for incremental bidirectional exporting of the
82           repository by keeping the marks the same across runs.
83
84       --fake-missing-tagger
85           Some old repositories have tags without a tagger. The fast-import
86           protocol was pretty strict about that, and did not allow that. So
87           fake a tagger to be able to fast-import the output.
88
89       --use-done-feature
90           Start the stream with a feature done stanza, and terminate it with
91           a done command.
92
93       --no-data
94           Skip output of blob objects and instead refer to blobs via their
95           original SHA-1 hash. This is useful when rewriting the directory
96           structure or history of a repository without touching the contents
97           of individual files. Note that the resulting stream can only be
98           used by a repository which already contains the necessary objects.
99
100       --full-tree
101           This option will cause fast-export to issue a "deleteall" directive
102           for each commit followed by a full list of all files in the commit
103           (as opposed to just listing the files which are different from the
104           commit’s first parent).
105
106       --anonymize
107           Anonymize the contents of the repository while still retaining the
108           shape of the history and stored tree. See the section on
109           ANONYMIZING below.
110
111       --reference-excluded-parents
112           By default, running a command such as git fast-export
113           master~5..master will not include the commit master~5 and will make
114           master~4 no longer have master~5 as a parent (though both the old
115           master~4 and new master~4 will have all the same files). Use
116           --reference-excluded-parents to instead have the stream refer to
117           commits in the excluded range of history by their sha1sum. Note
118           that the resulting stream can only be used by a repository which
119           already contains the necessary parent commits.
120
121       --show-original-ids
122           Add an extra directive to the output for commits and blobs,
123           original-oid <SHA1SUM>. While such directives will likely be
124           ignored by importers such as git-fast-import, it may be useful for
125           intermediary filters (e.g. for rewriting commit messages which
126           refer to older commits, or for stripping blobs by id).
127
128       --reencode=(yes|no|abort)
129           Specify how to handle encoding header in commit objects. When
130           asking to abort (which is the default), this program will die when
131           encountering such a commit object. With yes, the commit message
132           will be re-encoded into UTF-8. With no, the original encoding will
133           be preserved.
134
135       --refspec
136           Apply the specified refspec to each ref exported. Multiple of them
137           can be specified.
138
139       [<git-rev-list-args>...]
140           A list of arguments, acceptable to git rev-parse and git rev-list,
141           that specifies the specific objects and references to export. For
142           example, master~10..master causes the current master reference to
143           be exported along with all objects added since its 10th ancestor
144           commit and (unless the --reference-excluded-parents option is
145           specified) all files common to master~9 and master~10.
146

EXAMPLES

148           $ git fast-export --all | (cd /empty/repository && git fast-import)
149
150       This will export the whole repository and import it into the existing
151       empty repository. Except for reencoding commits that are not in UTF-8,
152       it would be a one-to-one mirror.
153
154           $ git fast-export master~5..master |
155                   sed "s|refs/heads/master|refs/heads/other|" |
156                   git fast-import
157
158       This makes a new branch called other from master~5..master (i.e. if
159       master has linear history, it will take the last 5 commits).
160
161       Note that this assumes that none of the blobs and commit messages
162       referenced by that revision range contains the string
163       refs/heads/master.
164

ANONYMIZING

166       If the --anonymize option is given, git will attempt to remove all
167       identifying information from the repository while still retaining
168       enough of the original tree and history patterns to reproduce some
169       bugs. The goal is that a git bug which is found on a private repository
170       will persist in the anonymized repository, and the latter can be shared
171       with git developers to help solve the bug.
172
173       With this option, git will replace all refnames, paths, blob contents,
174       commit and tag messages, names, and email addresses in the output with
175       anonymized data. Two instances of the same string will be replaced
176       equivalently (e.g., two commits with the same author will have the same
177       anonymized author in the output, but bear no resemblance to the
178       original author string). The relationship between commits, branches,
179       and tags is retained, as well as the commit timestamps (but the commit
180       messages and refnames bear no resemblance to the originals). The
181       relative makeup of the tree is retained (e.g., if you have a root tree
182       with 10 files and 3 trees, so will the output), but their names and the
183       contents of the files will be replaced.
184
185       If you think you have found a git bug, you can start by exporting an
186       anonymized stream of the whole repository:
187
188           $ git fast-export --anonymize --all >anon-stream
189
190       Then confirm that the bug persists in a repository created from that
191       stream (many bugs will not, as they really do depend on the exact
192       repository contents):
193
194           $ git init anon-repo
195           $ cd anon-repo
196           $ git fast-import <../anon-stream
197           $ ... test your bug ...
198
199       If the anonymized repository shows the bug, it may be worth sharing
200       anon-stream along with a regular bug report. Note that the anonymized
201       stream compresses very well, so gzipping it is encouraged. If you want
202       to examine the stream to see that it does not contain any private data,
203       you can peruse it directly before sending. You may also want to try:
204
205           $ perl -pe 's/\d+/X/g' <anon-stream | sort -u | less
206
207       which shows all of the unique lines (with numbers converted to "X", to
208       collapse "User 0", "User 1", etc into "User X"). This produces a much
209       smaller output, and it is usually easy to quickly confirm that there is
210       no private data in the stream.
211

LIMITATIONS

213       Since git fast-import cannot tag trees, you will not be able to export
214       the linux.git repository completely, as it contains a tag referencing a
215       tree instead of a commit.
216

SEE ALSO

218       git-fast-import(1)
219

GIT

221       Part of the git(1) suite
222
223
224
225Git 2.26.2                        2020-04-20                GIT-FAST-EXPORT(1)
Impressum