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