1GIT-FAST-EXPORT(1) Git Manual GIT-FAST-EXPORT(1)
2
3
4
6 git-fast-export - Git data exporter
7
9 git fast-export [<options>] | git fast-import
10
11
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 kind of an interactive git filter-branch.
18
20 --progress=<n>
21 Insert progress statements every <n> objects, to be shown by git
22 fast-import during import.
23
24 --signed-tags=(verbatim|warn|warn-strip|strip|abort)
25 Specify how to handle signed tags. Since any transformation after
26 the export can change the tag names (which can also happen when
27 excluding revisions) the signatures will not match.
28
29 When asking to abort (which is the default), this program will die
30 when encountering a signed tag. With strip, the tags will silently
31 be made unsigned, with warn-strip they will be made unsigned but a
32 warning will be displayed, with verbatim, they will be silently
33 exported and with warn, they will be exported, but you will see a
34 warning.
35
36 --tag-of-filtered-object=(abort|drop|rewrite)
37 Specify how to handle tags whose tagged object is filtered out.
38 Since revisions and files to export can be limited by path, tagged
39 objects may be filtered completely.
40
41 When asking to abort (which is the default), this program will die
42 when encountering such a tag. With drop it will omit such tags from
43 the output. With rewrite, if the tagged object is a commit, it will
44 rewrite the tag to tag an ancestor commit (via parent rewriting;
45 see git-rev-list(1))
46
47 -M, -C
48 Perform move and/or copy detection, as described in the git-diff(1)
49 manual page, and use it to generate rename and copy commands in the
50 output dump.
51
52 Note that earlier versions of this command did not complain and
53 produced incorrect results if you gave these options.
54
55 --export-marks=<file>
56 Dumps the internal marks table to <file> when complete. Marks are
57 written one per line as :markid SHA-1. Only marks for revisions are
58 dumped; marks for blobs are ignored. Backends can use this file to
59 validate imports after they have been completed, or to save the
60 marks table across incremental runs. As <file> is only opened and
61 truncated at completion, the same path can also be safely given to
62 --import-marks. The file will not be written if no new object has
63 been marked/exported.
64
65 --import-marks=<file>
66 Before processing any input, load the marks specified in <file>.
67 The input file must exist, must be readable, and must use the same
68 format as produced by --export-marks.
69
70 Any commits that have already been marked will not be exported
71 again. If the backend uses a similar --import-marks file, this
72 allows for incremental bidirectional exporting of the repository by
73 keeping the marks the same across runs.
74
75 --fake-missing-tagger
76 Some old repositories have tags without a tagger. The fast-import
77 protocol was pretty strict about that, and did not allow that. So
78 fake a tagger to be able to fast-import the output.
79
80 --use-done-feature
81 Start the stream with a feature done stanza, and terminate it with
82 a done command.
83
84 --no-data
85 Skip output of blob objects and instead refer to blobs via their
86 original SHA-1 hash. This is useful when rewriting the directory
87 structure or history of a repository without touching the contents
88 of individual files. Note that the resulting stream can only be
89 used by a repository which already contains the necessary objects.
90
91 --full-tree
92 This option will cause fast-export to issue a "deleteall" directive
93 for each commit followed by a full list of all files in the commit
94 (as opposed to just listing the files which are different from the
95 commit’s first parent).
96
97 --anonymize
98 Anonymize the contents of the repository while still retaining the
99 shape of the history and stored tree. See the section on
100 ANONYMIZING below.
101
102 --reference-excluded-parents
103 By default, running a command such as git fast-export
104 master~5..master will not include the commit master~5 and will make
105 master~4 no longer have master~5 as a parent (though both the old
106 master~4 and new master~4 will have all the same files). Use
107 --reference-excluded-parents to instead have the the stream refer
108 to commits in the excluded range of history by their sha1sum. Note
109 that the resulting stream can only be used by a repository which
110 already contains the necessary parent commits.
111
112 --show-original-ids
113 Add an extra directive to the output for commits and blobs,
114 original-oid <SHA1SUM>. While such directives will likely be
115 ignored by importers such as git-fast-import, it may be useful for
116 intermediary filters (e.g. for rewriting commit messages which
117 refer to older commits, or for stripping blobs by id).
118
119 --refspec
120 Apply the specified refspec to each ref exported. Multiple of them
121 can be specified.
122
123 [<git-rev-list-args>...]
124 A list of arguments, acceptable to git rev-parse and git rev-list,
125 that specifies the specific objects and references to export. For
126 example, master~10..master causes the current master reference to
127 be exported along with all objects added since its 10th ancestor
128 commit and (unless the --reference-excluded-parents option is
129 specified) all files common to master~9 and master~10.
130
132 $ git fast-export --all | (cd /empty/repository && git fast-import)
133
134
135 This will export the whole repository and import it into the existing
136 empty repository. Except for reencoding commits that are not in UTF-8,
137 it would be a one-to-one mirror.
138
139 $ git fast-export master~5..master |
140 sed "s|refs/heads/master|refs/heads/other|" |
141 git fast-import
142
143
144 This makes a new branch called other from master~5..master (i.e. if
145 master has linear history, it will take the last 5 commits).
146
147 Note that this assumes that none of the blobs and commit messages
148 referenced by that revision range contains the string
149 refs/heads/master.
150
152 If the --anonymize option is given, git will attempt to remove all
153 identifying information from the repository while still retaining
154 enough of the original tree and history patterns to reproduce some
155 bugs. The goal is that a git bug which is found on a private repository
156 will persist in the anonymized repository, and the latter can be shared
157 with git developers to help solve the bug.
158
159 With this option, git will replace all refnames, paths, blob contents,
160 commit and tag messages, names, and email addresses in the output with
161 anonymized data. Two instances of the same string will be replaced
162 equivalently (e.g., two commits with the same author will have the same
163 anonymized author in the output, but bear no resemblance to the
164 original author string). The relationship between commits, branches,
165 and tags is retained, as well as the commit timestamps (but the commit
166 messages and refnames bear no resemblance to the originals). The
167 relative makeup of the tree is retained (e.g., if you have a root tree
168 with 10 files and 3 trees, so will the output), but their names and the
169 contents of the files will be replaced.
170
171 If you think you have found a git bug, you can start by exporting an
172 anonymized stream of the whole repository:
173
174 $ git fast-export --anonymize --all >anon-stream
175
176
177 Then confirm that the bug persists in a repository created from that
178 stream (many bugs will not, as they really do depend on the exact
179 repository contents):
180
181 $ git init anon-repo
182 $ cd anon-repo
183 $ git fast-import <../anon-stream
184 $ ... test your bug ...
185
186
187 If the anonymized repository shows the bug, it may be worth sharing
188 anon-stream along with a regular bug report. Note that the anonymized
189 stream compresses very well, so gzipping it is encouraged. If you want
190 to examine the stream to see that it does not contain any private data,
191 you can peruse it directly before sending. You may also want to try:
192
193 $ perl -pe 's/\d+/X/g' <anon-stream | sort -u | less
194
195
196 which shows all of the unique lines (with numbers converted to "X", to
197 collapse "User 0", "User 1", etc into "User X"). This produces a much
198 smaller output, and it is usually easy to quickly confirm that there is
199 no private data in the stream.
200
202 Since git fast-import cannot tag trees, you will not be able to export
203 the linux.git repository completely, as it contains a tag referencing a
204 tree instead of a commit.
205
207 git-fast-import(1)
208
210 Part of the git(1) suite
211
212
213
214Git 2.21.0 02/24/2019 GIT-FAST-EXPORT(1)