1 GIT-EXPORT-FILTER(1) Git Manual GIT-EXPORT-FILTER(1)
6 git-export-filter - Filter fast-export data with optional rewrites
9 git export-filter [--verbose|-v] [-h|--help] [--version|-V] [--debug|-d]
10 [--authors-file=<authors_file> [--require-authors]]
11 [--branches-file=<branches_file>] [--trunk-is-master]
12 [--convert-tagger=<email>] [--strip-at-suffix]
13 [--expand-renames] [--names] [--]
14 [<input_file>] > <output_file>
18 Filters a git fast-export data stream optionally rewriting author
19 and/or branch names along the way and writes the result to standard
22 When given no options or arguments, simply copies the input to the
23 output. In this case the input is still parsed and invalid fast-export
24 input data will still be detected even though no rewriting is being
29 Show additional information on standard error while processing the
33 Show basic help. If --verbose is given first show extensive help.
34 No conversion is performed if this option is given.
37 Show the version information. No conversion is performed if this
41 Show debugging information on standard error during the conversion.
43 --authors-file <authors_file>
44 Specifies author/committer names to rewrite. See the "REWRITE FILE
45 FORMAT" below for information on <authors_file> format.
48 May only be specified if --authors-file is also specified. If this
49 option is given, then all author/committer names encountered in the
50 input stream must be found in <authors_file> or an error will occur
51 and the conversion will stop. If this option is not given then
52 author/committer names not listed in <authors_file> are left
55 --branches-file <branches_file>
56 Specifies branch and/or tag names to rewrite. See the "REWRITE FILE
57 FORMAT" below for information on <branches_file> format.
59 Annotated tag names can be renamed but only if they are located
60 under refs/tags/ as the fast-export file format forces that prefix
61 to be present. The refs/tags/ prefix must be included in the
62 <branches_file> on both the left and right sides of the = in order
63 to successfully rewrite annotated tag names.
66 Giving this option converts refs/heads/trunk to refs/heads/master
67 in the output. The --trunk-is-master option can be given in place
68 of or in addition to the --branches-file option.
70 Really this is just intended to be a shortcut to having a
71 <branches_file> with a single line
72 refs/heads/trunk=refs/heads/master in it.
74 --convert-tagger <email>
75 If this option is given, then any annotated tags with a committer
76 that has an email of <email> will be converted to a lightweight
79 Some fast-export producers create tag commands which always use a
80 fixed tagger (typically tagger) with a data length of 0 and a
81 timestamp identical to the commit that is being tagged. In other
82 words, a lightweight tag in disguise.
84 The --convert-tagger option can be used to convert these
85 lightweight-tag-in-disguise annotated tags to a real lightweight
89 If this option is given then when converting author/committer
90 names, if the authors file does not contain an exact match for the
91 email and the email contains an @ sign then the email is looked up
92 again after stripping everything starting with and including the @
93 character from the end.
95 The svn-fe utility appends @... suffixes to the email addresses it
96 generates in the fast-export data and will need this option to use
97 a standard git svn authors file.
100 Some importers of fast-export data cannot handle renames but can
101 handle copies. If --expand-renames is given then any instances of
102 filerename 'R' are replaced with a filecopy 'C' followed by a
103 filedelete 'D' instead.
106 This option may not be combined with any of the others. Instead of
107 outputting a modified fast-import stream, output only the author,
108 committer and tagger names as they are encountered one per line
109 without any timestamp information. This can be used to help build
110 an initial authors file.
112 Do note that the names are output as-is from the input stream
113 whereas this utility expects to match only the email portion when
114 given an authors file with the --authors-file option. This means
115 the name, non-email portion and surrounding < and > characters will
116 have to be removed from the output provided by this option.
117 Additionally, of course, duplicate names need to be removed as
121 The fast-export stream to read. If <input_file> is omitted, then
122 standard input will be read.
125 Syntax is compatible with the git svn --authors-file and git cvsimport
126 -A files. For committer/author rewrites the syntax looks like:
128 email = John Smith <smith@example.com>
131 And for branch rewrites it looks like:
133 refs/heads/ALL_CAPS = refs/heads/small_caps
136 Blank lines and lines starting with # are ignored.
138 Note that when rewriting author/committer names, only the <email>
139 portion (the part between < and >) of the name is matched, the rest of
140 the name is ignored for matching purposes.
143 If the input data is the result of fossil export --git then probably
144 the --trunk-is-master and --convert-tagger tagger options will be
148 Kyle J. McKay <mackyle@gmail.com>
151 Not part of the git(1) suite yet
155 Git GIT-EXPORT-FILTER(1)