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
11

DESCRIPTION

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

OPTIONS

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

EXAMPLES

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

ANONYMIZING

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

LIMITATIONS

219       Since git fast-import cannot tag trees, you will not be able to export
220       the linux.git repository completely, as it contains a tag referencing a
221       tree instead of a commit.
222

SEE ALSO

224       git-fast-import(1)
225

GIT

227       Part of the git(1) suite
228
229
230
231Git 2.24.1                        12/10/2019                GIT-FAST-EXPORT(1)
Impressum