blob: 11427acdde68e659ca5d443beff037df8c9f3ebb [file] [log] [blame]
Junio C Hamano0c999702007-12-03 09:57:551git-fast-export(1)
2==================
3
4NAME
5----
6git-fast-export - Git data exporter
7
8
9SYNOPSIS
10--------
Junio C Hamano15567bc2011-07-23 00:51:5911[verse]
Junio C Hamanoc9cb5172018-06-01 07:13:4412'git fast-export [<options>]' | 'git fast-import'
Junio C Hamano0c999702007-12-03 09:57:5513
14DESCRIPTION
15-----------
16This program dumps the given revisions in a form suitable to be piped
Junio C Hamano1aa40d22010-01-21 17:46:4317into 'git fast-import'.
Junio C Hamano0c999702007-12-03 09:57:5518
Junio C Hamanoec87f522008-12-10 08:35:2519You can use it as a human-readable bundle replacement (see
Junio C Hamano35738e82008-01-07 07:55:4620linkgit:git-bundle[1]), or as a kind of an interactive
Junio C Hamano1aa40d22010-01-21 17:46:4321'git filter-branch'.
Junio C Hamano0c999702007-12-03 09:57:5522
23
24OPTIONS
25-------
26--progress=<n>::
27Insert 'progress' statements every <n> objects, to be shown by
Junio C Hamano1aa40d22010-01-21 17:46:4328'git fast-import' during import.
Junio C Hamano0c999702007-12-03 09:57:5529
Junio C Hamanoac002b62013-04-25 01:02:5830--signed-tags=(verbatim|warn|warn-strip|strip|abort)::
Junio C Hamano0c999702007-12-03 09:57:5531Specify how to handle signed tags. Since any transformation
32after the export can change the tag names (which can also happen
33when excluding revisions) the signatures will not match.
34+
35When asking to 'abort' (which is the default), this program will die
Junio C Hamanoac002b62013-04-25 01:02:5836when encountering a signed tag. With 'strip', the tags will silently
37be made unsigned, with 'warn-strip' they will be made unsigned but a
38warning will be displayed, with 'verbatim', they will be silently
39exported and with 'warn', they will be exported, but you will see a
40warning.
Junio C Hamano0c999702007-12-03 09:57:5541
Junio C Hamanoceec6ab2009-07-26 21:37:5242--tag-of-filtered-object=(abort|drop|rewrite)::
Junio C Hamano167b1382010-01-31 23:04:3143Specify how to handle tags whose tagged object is filtered out.
Junio C Hamanoceec6ab2009-07-26 21:37:5244Since revisions and files to export can be limited by path,
45tagged objects may be filtered completely.
46+
47When asking to 'abort' (which is the default), this program will die
48when encountering such a tag. With 'drop' it will omit such tags from
49the output. With 'rewrite', if the tagged object is a commit, it will
50rewrite the tag to tag an ancestor commit (via parent rewriting; see
51linkgit:git-rev-list[1])
52
Junio C Hamano7f80ae82008-07-30 18:31:3553-M::
54-C::
55Perform move and/or copy detection, as described in the
56linkgit:git-diff[1] manual page, and use it to generate
57rename and copy commands in the output dump.
58+
59Note that earlier versions of this command did not complain and
60produced incorrect results if you gave these options.
61
Junio C Hamano4224f992008-06-23 07:14:0862--export-marks=<file>::
63Dumps the internal marks table to <file> when complete.
64Marks are written one per line as `:markid SHA-1`. Only marks
65for revisions are dumped; marks for blobs are ignored.
66Backends can use this file to validate imports after they
67have been completed, or to save the marks table across
68incremental runs. As <file> is only opened and truncated
69at completion, the same path can also be safely given to
Junio C Hamano1dbca522015-05-22 20:48:5570--import-marks.
Junio C Hamano63b6fdb2013-04-07 23:37:1371The file will not be written if no new object has been
72marked/exported.
Junio C Hamano4224f992008-06-23 07:14:0873
74--import-marks=<file>::
75Before processing any input, load the marks specified in
76<file>. The input file must exist, must be readable, and
Junio C Hamano1dbca522015-05-22 20:48:5577must use the same format as produced by --export-marks.
Junio C Hamano4224f992008-06-23 07:14:0878+
79Any commits that have already been marked will not be exported again.
Junio C Hamano1dbca522015-05-22 20:48:5580If the backend uses a similar --import-marks file, this allows for
Junio C Hamano4224f992008-06-23 07:14:0881incremental bidirectional exporting of the repository by keeping the
82marks the same across runs.
83
Junio C Hamano54bf1e22008-12-20 06:30:1184--fake-missing-tagger::
85Some old repositories have tags without a tagger. The
86fast-import protocol was pretty strict about that, and did not
87allow that. So fake a tagger to be able to fast-import the
88output.
89
Junio C Hamanofbc773c2011-08-02 00:09:1290--use-done-feature::
91Start the stream with a 'feature done' stanza, and terminate
92it with a 'done' command.
93
Junio C Hamanobacccda2009-08-03 08:07:1294--no-data::
95Skip output of blob objects and instead refer to blobs via
96their original SHA-1 hash. This is useful when rewriting the
97directory structure or history of a repository without
98touching the contents of individual files. Note that the
99resulting stream can only be used by a repository which
100already contains the necessary objects.
101
Junio C Hamano075ae872010-09-01 18:43:07102--full-tree::
103This option will cause fast-export to issue a "deleteall"
104directive for each commit followed by a full list of all files
105in the commit (as opposed to just listing the files which are
106different from the commit's first parent).
107
Junio C Hamanoac12f0e2014-09-19 22:32:51108--anonymize::
109Anonymize the contents of the repository while still retaining
110the shape of the history and stored tree. See the section on
111`ANONYMIZING` below.
112
Junio C Hamanode48f452019-01-04 22:31:57113--reference-excluded-parents::
114By default, running a command such as `git fast-export
115master~5..master` will not include the commit master{tilde}5
116and will make master{tilde}4 no longer have master{tilde}5 as
117a parent (though both the old master{tilde}4 and new
118master{tilde}4 will have all the same files). Use
119--reference-excluded-parents to instead have the the stream
120refer to commits in the excluded range of history by their
121sha1sum. Note that the resulting stream can only be used by a
122repository which already contains the necessary parent
123commits.
124
125--show-original-ids::
126Add an extra directive to the output for commits and blobs,
127`original-oid <SHA1SUM>`. While such directives will likely be
128ignored by importers such as git-fast-import, it may be useful
129for intermediary filters (e.g. for rewriting commit messages
130which refer to older commits, or for stripping blobs by id).
131
Junio C Hamano51937872019-06-13 22:09:30132--reencode=(yes|no|abort)::
133Specify how to handle `encoding` header in commit objects. When
134asking to 'abort' (which is the default), this program will die
135when encountering such a commit object. With 'yes', the commit
136message will be reencoded into UTF-8. With 'no', the original
137encoding will be preserved.
138
Junio C Hamanoc8c398a2014-06-16 21:14:05139--refspec::
140Apply the specified refspec to each ref exported. Multiple of them can
141be specified.
142
Junio C Hamanod2179ef2010-10-22 04:12:17143[<git-rev-list-args>...]::
Junio C Hamano3d1b5a12013-05-17 23:34:02144A list of arguments, acceptable to 'git rev-parse' and
145'git rev-list', that specifies the specific objects and references
146to export. For example, `master~10..master` causes the
147current master reference to be exported along with all objects
Junio C Hamanode48f452019-01-04 22:31:57148added since its 10th ancestor commit and (unless the
149--reference-excluded-parents option is specified) all files
150common to master{tilde}9 and master{tilde}10.
Junio C Hamano0c999702007-12-03 09:57:55151
152EXAMPLES
153--------
154
155-------------------------------------------------------------------
156$ git fast-export --all | (cd /empty/repository && git fast-import)
157-------------------------------------------------------------------
158
159This will export the whole repository and import it into the existing
160empty repository. Except for reencoding commits that are not in
161UTF-8, it would be a one-to-one mirror.
162
163-----------------------------------------------------
164$ git fast-export master~5..master |
165sed "s|refs/heads/master|refs/heads/other|" |
166git fast-import
167-----------------------------------------------------
168
169This makes a new branch called 'other' from 'master~5..master'
170(i.e. if 'master' has linear history, it will take the last 5 commits).
171
172Note that this assumes that none of the blobs and commit messages
173referenced by that revision range contains the string
174'refs/heads/master'.
175
176
Junio C Hamanoac12f0e2014-09-19 22:32:51177ANONYMIZING
178-----------
179
180If the `--anonymize` option is given, git will attempt to remove all
181identifying information from the repository while still retaining enough
182of the original tree and history patterns to reproduce some bugs. The
183goal is that a git bug which is found on a private repository will
184persist in the anonymized repository, and the latter can be shared with
185git developers to help solve the bug.
186
187With this option, git will replace all refnames, paths, blob contents,
188commit and tag messages, names, and email addresses in the output with
189anonymized data. Two instances of the same string will be replaced
190equivalently (e.g., two commits with the same author will have the same
191anonymized author in the output, but bear no resemblance to the original
192author string). The relationship between commits, branches, and tags is
193retained, as well as the commit timestamps (but the commit messages and
194refnames bear no resemblance to the originals). The relative makeup of
195the tree is retained (e.g., if you have a root tree with 10 files and 3
196trees, so will the output), but their names and the contents of the
197files will be replaced.
198
199If you think you have found a git bug, you can start by exporting an
200anonymized stream of the whole repository:
201
202---------------------------------------------------
203$ git fast-export --anonymize --all >anon-stream
204---------------------------------------------------
205
206Then confirm that the bug persists in a repository created from that
207stream (many bugs will not, as they really do depend on the exact
208repository contents):
209
210---------------------------------------------------
211$ git init anon-repo
212$ cd anon-repo
213$ git fast-import <../anon-stream
214$ ... test your bug ...
215---------------------------------------------------
216
217If the anonymized repository shows the bug, it may be worth sharing
218`anon-stream` along with a regular bug report. Note that the anonymized
219stream compresses very well, so gzipping it is encouraged. If you want
220to examine the stream to see that it does not contain any private data,
221you can peruse it directly before sending. You may also want to try:
222
223---------------------------------------------------
224$ perl -pe 's/\d+/X/g' <anon-stream | sort -u | less
225---------------------------------------------------
226
227which shows all of the unique lines (with numbers converted to "X", to
228collapse "User 0", "User 1", etc into "User X"). This produces a much
229smaller output, and it is usually easy to quickly confirm that there is
230no private data in the stream.
231
232
Junio C Hamanob9d9d902018-05-23 07:07:42233LIMITATIONS
Junio C Hamano0c999702007-12-03 09:57:55234-----------
235
Junio C Hamano1aa40d22010-01-21 17:46:43236Since 'git fast-import' cannot tag trees, you will not be
Junio C Hamanoa1952302013-07-01 21:31:18237able to export the linux.git repository completely, as it contains
Junio C Hamano0c999702007-12-03 09:57:55238a tag referencing a tree instead of a commit.
239
Junio C Hamano13220242014-11-19 23:06:27240SEE ALSO
241--------
242linkgit:git-fast-import[1]
243
Junio C Hamano0c999702007-12-03 09:57:55244GIT
245---
Junio C Hamanof7c042d2008-06-06 22:50:53246Part of the linkgit:git[1] suite