make some more strings translatable
[TortoiseGit.git] / doc / source / en / TortoiseGit / git_doc / git-svn.html.xml
blobdc57c00a831df9aca17b16b2abe5c08d637dee74
1 <?xml version="1.0" encoding="UTF-8"?>\r
2 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">\r
3 \r
4 <article lang="en" id="git-svn(1)">\r
5 <articleinfo>\r
6     <title>git-svn(1)</title>\r
7         <indexterm>\r
8                 <primary>git-svn(1)</primary>\r
9         </indexterm>\r
10 </articleinfo>\r
11 <simplesect id="_name">\r
12 <title>NAME</title>\r
13 <simpara>git-svn - Bidirectional operation between a single Subversion branch and git</simpara>\r
14 </simplesect>\r
15 <simplesect id="_synopsis">\r
16 <title>SYNOPSIS</title>\r
17 <simpara><emphasis>git svn</emphasis> &lt;command&gt; [options] [arguments]</simpara>\r
18 </simplesect>\r
19 <simplesect id="_description">\r
20 <title>DESCRIPTION</title>\r
21 <simpara><emphasis>git-svn</emphasis> is a simple conduit for changesets between Subversion and git.\r
22 It provides a bidirectional flow of changes between a Subversion and a git\r
23 repository.</simpara>\r
24 <simpara><emphasis>git-svn</emphasis> can track a single Subversion branch simply by using a\r
25 URL to the branch, follow branches laid out in the Subversion recommended\r
26 method (trunk, branches, tags directories) with the --stdlayout option, or\r
27 follow branches in any layout with the -T/-t/-b options (see options to\r
28 <emphasis>init</emphasis> below, and also the <emphasis>clone</emphasis> command).</simpara>\r
29 <simpara>Once tracking a Subversion branch (with any of the above methods), the git\r
30 repository can be updated from Subversion by the <emphasis>fetch</emphasis> command and\r
31 Subversion updated from git by the <emphasis>dcommit</emphasis> command.</simpara>\r
32 </simplesect>\r
33 <simplesect id="_commands">\r
34 <title>COMMANDS</title>\r
35 <variablelist>\r
36 <varlistentry>\r
37 <term>\r
38 <emphasis>init</emphasis>\r
39 </term>\r
40 <listitem>\r
41 <simpara>\r
42         Initializes an empty git repository with additional\r
43         metadata directories for <emphasis>git-svn</emphasis>.  The Subversion URL\r
44         may be specified as a command-line argument, or as full\r
45         URL arguments to -T/-t/-b.  Optionally, the target\r
46         directory to operate on can be specified as a second\r
47         argument.  Normally this command initializes the current\r
48         directory.\r
49 </simpara>\r
50 <variablelist>\r
51 <varlistentry>\r
52 <term>\r
53 -T&lt;trunk_subdir&gt;\r
54 </term>\r
55 <term>\r
56 --trunk=&lt;trunk_subdir&gt;\r
57 </term>\r
58 <term>\r
59 -t&lt;tags_subdir&gt;\r
60 </term>\r
61 <term>\r
62 --tags=&lt;tags_subdir&gt;\r
63 </term>\r
64 <term>\r
65 -b&lt;branches_subdir&gt;\r
66 </term>\r
67 <term>\r
68 --branches=&lt;branches_subdir&gt;\r
69 </term>\r
70 <term>\r
71 -s\r
72 </term>\r
73 <term>\r
74 --stdlayout\r
75 </term>\r
76 <listitem>\r
77 <simpara>\r
78         These are optional command-line options for init.  Each of\r
79         these flags can point to a relative repository path\r
80         (--tags=project/tags') or a full url\r
81         (--tags=https://foo.org/project/tags). The option --stdlayout is\r
82         a shorthand way of setting trunk,tags,branches as the relative paths,\r
83         which is the Subversion default. If any of the other options are given\r
84         as well, they take precedence.\r
85 </simpara>\r
86 </listitem>\r
87 </varlistentry>\r
88 <varlistentry>\r
89 <term>\r
90 --no-metadata\r
91 </term>\r
92 <listitem>\r
93 <simpara>\r
94         Set the <emphasis>noMetadata</emphasis> option in the [svn-remote] config.\r
95 </simpara>\r
96 </listitem>\r
97 </varlistentry>\r
98 <varlistentry>\r
99 <term>\r
100 --use-svm-props\r
101 </term>\r
102 <listitem>\r
103 <simpara>\r
104         Set the <emphasis>useSvmProps</emphasis> option in the [svn-remote] config.\r
105 </simpara>\r
106 </listitem>\r
107 </varlistentry>\r
108 <varlistentry>\r
109 <term>\r
110 --use-svnsync-props\r
111 </term>\r
112 <listitem>\r
113 <simpara>\r
114         Set the <emphasis>useSvnsyncProps</emphasis> option in the [svn-remote] config.\r
115 </simpara>\r
116 </listitem>\r
117 </varlistentry>\r
118 <varlistentry>\r
119 <term>\r
120 --rewrite-root=&lt;URL&gt;\r
121 </term>\r
122 <listitem>\r
123 <simpara>\r
124         Set the <emphasis>rewriteRoot</emphasis> option in the [svn-remote] config.\r
125 </simpara>\r
126 </listitem>\r
127 </varlistentry>\r
128 <varlistentry>\r
129 <term>\r
130 --use-log-author\r
131 </term>\r
132 <listitem>\r
133 <simpara>\r
134         When retrieving svn commits into git (as part of fetch, rebase, or\r
135         dcommit operations), look for the first From: or Signed-off-by: line\r
136         in the log message and use that as the author string.\r
137 </simpara>\r
138 </listitem>\r
139 </varlistentry>\r
140 <varlistentry>\r
141 <term>\r
142 --add-author-from\r
143 </term>\r
144 <listitem>\r
145 <simpara>\r
146         When committing to svn from git (as part of commit or dcommit\r
147         operations), if the existing log message doesn&#8217;t already have a\r
148         From: or Signed-off-by: line, append a From: line based on the\r
149         git commit&#8217;s author string.  If you use this, then --use-log-author\r
150         will retrieve a valid author string for all commits.\r
151 </simpara>\r
152 </listitem>\r
153 </varlistentry>\r
154 <varlistentry>\r
155 <term>\r
156 --username=&lt;USER&gt;\r
157 </term>\r
158 <listitem>\r
159 <simpara>\r
160         For transports that SVN handles authentication for (http,\r
161         https, and plain svn), specify the username.  For other\r
162         transports (eg svn+ssh://), you must include the username in\r
163         the URL, eg svn+ssh://<ulink url="mailto:foo@svn.bar.com">foo@svn.bar.com</ulink>/project\r
164 </simpara>\r
165 </listitem>\r
166 </varlistentry>\r
167 <varlistentry>\r
168 <term>\r
169 --prefix=&lt;prefix&gt;\r
170 </term>\r
171 <listitem>\r
172 <simpara>\r
173         This allows one to specify a prefix which is prepended\r
174         to the names of remotes if trunk/branches/tags are\r
175         specified.  The prefix does not automatically include a\r
176         trailing slash, so be sure you include one in the\r
177         argument if that is what you want.  If --branches/-b is\r
178         specified, the prefix must include a trailing slash.\r
179         Setting a prefix is useful if you wish to track multiple\r
180         projects that share a common repository.\r
181 </simpara>\r
182 </listitem>\r
183 </varlistentry>\r
184 </variablelist>\r
185 </listitem>\r
186 </varlistentry>\r
187 <varlistentry>\r
188 <term>\r
189 <emphasis>fetch</emphasis>\r
190 </term>\r
191 <listitem>\r
192 <simpara>\r
193         Fetch unfetched revisions from the Subversion remote we are\r
194         tracking.  The name of the [svn-remote "&#8230;"] section in the\r
195         .git/config file may be specified as an optional command-line\r
196         argument.\r
197 </simpara>\r
198 <variablelist>\r
199 <varlistentry>\r
200 <term>\r
201 --localtime\r
202 </term>\r
203 <listitem>\r
204 <simpara>\r
205         Store Git commit times in the local timezone instead of UTC.  This\r
206         makes <emphasis>git-log</emphasis> (even without --date=local) show the same times\r
207         that <literal>svn log</literal> would in the local timezone.\r
208 </simpara>\r
209 </listitem>\r
210 </varlistentry>\r
211 </variablelist>\r
212 </listitem>\r
213 </varlistentry>\r
214 </variablelist>\r
215 <simpara>This doesn&#8217;t interfere with interoperating with the Subversion\r
216 repository you cloned from, but if you wish for your local Git\r
217 repository to be able to interoperate with someone else&#8217;s local Git\r
218 repository, either don&#8217;t use this option or you should both use it in\r
219 the same local timezone.</simpara>\r
220 <variablelist>\r
221 <varlistentry>\r
222 <term>\r
223 --ignore-paths=&lt;regex&gt;\r
224 </term>\r
225 <listitem>\r
226 <simpara>\r
227         This allows one to specify Perl regular expression that will\r
228         cause skipping of all matching paths from checkout from SVN.\r
229         Examples:\r
230 </simpara>\r
231 <literallayout class="monospaced">--ignore-paths="^doc" - skip "doc*" directory for every fetch.</literallayout>\r
232 <literallayout class="monospaced">--ignore-paths="^[^/]+/(?:branches|tags)" - skip "branches"\r
233     and "tags" of first level directories.</literallayout>\r
234 <literallayout class="monospaced">Regular expression is not persistent, you should specify\r
235 it every time when fetching.</literallayout>\r
236 <variablelist>\r
237 <varlistentry>\r
238 <term>\r
239 <emphasis>clone</emphasis>\r
240 </term>\r
241 <listitem>\r
242 <simpara>\r
243         Runs <emphasis>init</emphasis> and <emphasis>fetch</emphasis>.  It will automatically create a\r
244         directory based on the basename of the URL passed to it;\r
245         or if a second argument is passed; it will create a directory\r
246         and work within that.  It accepts all arguments that the\r
247         <emphasis>init</emphasis> and <emphasis>fetch</emphasis> commands accept; with the exception of\r
248         <emphasis>--fetch-all</emphasis>.   After a repository is cloned, the <emphasis>fetch</emphasis>\r
249         command will be able to update revisions without affecting\r
250         the working tree; and the <emphasis>rebase</emphasis> command will be able\r
251         to update the working tree with the latest changes.\r
252 </simpara>\r
253 </listitem>\r
254 </varlistentry>\r
255 <varlistentry>\r
256 <term>\r
257 <emphasis>rebase</emphasis>\r
258 </term>\r
259 <listitem>\r
260 <simpara>\r
261         This fetches revisions from the SVN parent of the current HEAD\r
262         and rebases the current (uncommitted to SVN) work against it.\r
263 </simpara>\r
264 </listitem>\r
265 </varlistentry>\r
266 </variablelist>\r
267 </listitem>\r
268 </varlistentry>\r
269 </variablelist>\r
270 <simpara>This works similarly to <literal>svn update</literal> or <emphasis>git-pull</emphasis> except that\r
271 it preserves linear history with <emphasis>git-rebase</emphasis> instead of\r
272 <emphasis>git-merge</emphasis> for ease of dcommitting with <emphasis>git-svn</emphasis>.</simpara>\r
273 <simpara>This accepts all options that <emphasis>git-svn fetch</emphasis> and <emphasis>git-rebase</emphasis>\r
274 accept.  However, <emphasis>--fetch-all</emphasis> only fetches from the current\r
275 [svn-remote], and not all [svn-remote] definitions.</simpara>\r
276 <simpara>Like <emphasis>git-rebase</emphasis>; this requires that the working tree be clean\r
277 and have no uncommitted changes.</simpara>\r
278 <variablelist>\r
279 <varlistentry>\r
280 <term>\r
281 -l\r
282 </term>\r
283 <term>\r
284 --local\r
285 </term>\r
286 <listitem>\r
287 <simpara>\r
288         Do not fetch remotely; only run <emphasis>git-rebase</emphasis> against the\r
289         last fetched commit from the upstream SVN.\r
290 </simpara>\r
291 <variablelist>\r
292 <varlistentry>\r
293 <term>\r
294 <emphasis>dcommit</emphasis>\r
295 </term>\r
296 <listitem>\r
297 <simpara>\r
298         Commit each diff from a specified head directly to the SVN\r
299         repository, and then rebase or reset (depending on whether or\r
300         not there is a diff between SVN and head).  This will create\r
301         a revision in SVN for each commit in git.\r
302         It is recommended that you run <emphasis>git-svn</emphasis> fetch and rebase (not\r
303         pull or merge) your commits against the latest changes in the\r
304         SVN repository.\r
305         An optional command-line argument may be specified as an\r
306         alternative to HEAD.\r
307         This is advantageous over <emphasis>set-tree</emphasis> (below) because it produces\r
308         cleaner, more linear history.\r
309 </simpara>\r
310 </listitem>\r
311 </varlistentry>\r
312 </variablelist>\r
313 </listitem>\r
314 </varlistentry>\r
315 <varlistentry>\r
316 <term>\r
317 --no-rebase\r
318 </term>\r
319 <listitem>\r
320 <simpara>\r
321         After committing, do not rebase or reset.\r
322 </simpara>\r
323 </listitem>\r
324 </varlistentry>\r
325 <varlistentry>\r
326 <term>\r
327 --commit-url &lt;URL&gt;\r
328 </term>\r
329 <listitem>\r
330 <simpara>\r
331         Commit to this SVN URL (the full path).  This is intended to\r
332         allow existing git-svn repositories created with one transport\r
333         method (e.g. <literal>svn://</literal> or <literal>http://</literal> for anonymous read) to be\r
334         reused if a user is later given access to an alternate transport\r
335         method (e.g. <literal>svn+ssh://</literal> or <literal>https://</literal>) for commit.\r
336 </simpara>\r
337 <literallayout class="monospaced">Using this option for any other purpose (don't ask)\r
338 is very strongly discouraged.</literallayout>\r
339 </listitem>\r
340 </varlistentry>\r
341 </variablelist>\r
342 <variablelist>\r
343 <varlistentry>\r
344 <term>\r
345 <emphasis>branch</emphasis>\r
346 </term>\r
347 <listitem>\r
348 <simpara>\r
349         Create a branch in the SVN repository.\r
350 </simpara>\r
351 <variablelist>\r
352 <varlistentry>\r
353 <term>\r
354 -m\r
355 </term>\r
356 <term>\r
357 --message\r
358 </term>\r
359 <listitem>\r
360 <simpara>\r
361         Allows to specify the commit message.\r
362 </simpara>\r
363 </listitem>\r
364 </varlistentry>\r
365 <varlistentry>\r
366 <term>\r
367 -t\r
368 </term>\r
369 <term>\r
370 --tag\r
371 </term>\r
372 <listitem>\r
373 <simpara>\r
374         Create a tag by using the tags_subdir instead of the branches_subdir\r
375         specified during git svn init.\r
376 </simpara>\r
377 </listitem>\r
378 </varlistentry>\r
379 </variablelist>\r
380 </listitem>\r
381 </varlistentry>\r
382 <varlistentry>\r
383 <term>\r
384 <emphasis>tag</emphasis>\r
385 </term>\r
386 <listitem>\r
387 <simpara>\r
388         Create a tag in the SVN repository. This is a shorthand for\r
389         <emphasis>branch -t</emphasis>.\r
390 </simpara>\r
391 </listitem>\r
392 </varlistentry>\r
393 <varlistentry>\r
394 <term>\r
395 <emphasis>log</emphasis>\r
396 </term>\r
397 <listitem>\r
398 <simpara>\r
399         This should make it easy to look up svn log messages when svn\r
400         users refer to -r/--revision numbers.\r
401 </simpara>\r
402 <simpara>The following features from &#8216;svn log&#8217; are supported:</simpara>\r
403 <variablelist>\r
404 <varlistentry>\r
405 <term>\r
406 --revision=&lt;n&gt;[:&lt;n&gt;]\r
407 </term>\r
408 <listitem>\r
409 <simpara>\r
410         is supported, non-numeric args are not:\r
411         HEAD, NEXT, BASE, PREV, etc &#8230;\r
412 </simpara>\r
413 </listitem>\r
414 </varlistentry>\r
415 <varlistentry>\r
416 <term>\r
417 -v/--verbose\r
418 </term>\r
419 <listitem>\r
420 <simpara>\r
421         it&#8217;s not completely compatible with the --verbose\r
422         output in svn log, but reasonably close.\r
423 </simpara>\r
424 </listitem>\r
425 </varlistentry>\r
426 <varlistentry>\r
427 <term>\r
428 --limit=&lt;n&gt;\r
429 </term>\r
430 <listitem>\r
431 <simpara>\r
432         is NOT the same as --max-count, doesn&#8217;t count\r
433         merged/excluded commits\r
434 </simpara>\r
435 </listitem>\r
436 </varlistentry>\r
437 <varlistentry>\r
438 <term>\r
439 --incremental\r
440 </term>\r
441 <listitem>\r
442 <simpara>\r
443         supported\r
444 </simpara>\r
445 </listitem>\r
446 </varlistentry>\r
447 </variablelist>\r
448 <simpara>New features:</simpara>\r
449 <variablelist>\r
450 <varlistentry>\r
451 <term>\r
452 --show-commit\r
453 </term>\r
454 <listitem>\r
455 <simpara>\r
456         shows the git commit sha1, as well\r
457 </simpara>\r
458 </listitem>\r
459 </varlistentry>\r
460 <varlistentry>\r
461 <term>\r
462 --oneline\r
463 </term>\r
464 <listitem>\r
465 <simpara>\r
466         our version of --pretty=oneline\r
467 </simpara>\r
468 </listitem>\r
469 </varlistentry>\r
470 </variablelist>\r
471 <note><simpara>SVN itself only stores times in UTC and nothing else. The regular svn\r
472 client converts the UTC time to the local time (or based on the TZ=\r
473 environment). This command has the same behaviour.</simpara></note>\r
474 <simpara>Any other arguments are passed directly to <emphasis>git-log</emphasis></simpara>\r
475 </listitem>\r
476 </varlistentry>\r
477 <varlistentry>\r
478 <term>\r
479 <emphasis>blame</emphasis>\r
480 </term>\r
481 <listitem>\r
482 <simpara>\r
483        Show what revision and author last modified each line of a file. The\r
484        output of this mode is format-compatible with the output of\r
485        &#8216;svn blame&#8217; by default. Like the SVN blame command,\r
486        local uncommitted changes in the working copy are ignored;\r
487        the version of the file in the HEAD revision is annotated. Unknown\r
488        arguments are passed directly to <emphasis>git-blame</emphasis>.\r
489 </simpara>\r
490 <variablelist>\r
491 <varlistentry>\r
492 <term>\r
493 --git-format\r
494 </term>\r
495 <listitem>\r
496 <simpara>\r
497         Produce output in the same format as <emphasis>git-blame</emphasis>, but with\r
498         SVN revision numbers instead of git commit hashes. In this mode,\r
499         changes that haven&#8217;t been committed to SVN (including local\r
500         working-copy edits) are shown as revision 0.\r
501 </simpara>\r
502 </listitem>\r
503 </varlistentry>\r
504 </variablelist>\r
505 </listitem>\r
506 </varlistentry>\r
507 </variablelist>\r
508 <variablelist>\r
509 <varlistentry>\r
510 <term>\r
511 <emphasis>find-rev</emphasis>\r
512 </term>\r
513 <listitem>\r
514 <simpara>\r
515         When given an SVN revision number of the form <emphasis>rN</emphasis>, returns the\r
516         corresponding git commit hash (this can optionally be followed by a\r
517         tree-ish to specify which branch should be searched).  When given a\r
518         tree-ish, returns the corresponding SVN revision number.\r
519 </simpara>\r
520 </listitem>\r
521 </varlistentry>\r
522 <varlistentry>\r
523 <term>\r
524 <emphasis>set-tree</emphasis>\r
525 </term>\r
526 <listitem>\r
527 <simpara>\r
528         You should consider using <emphasis>dcommit</emphasis> instead of this command.\r
529         Commit specified commit or tree objects to SVN.  This relies on\r
530         your imported fetch data being up-to-date.  This makes\r
531         absolutely no attempts to do patching when committing to SVN, it\r
532         simply overwrites files with those specified in the tree or\r
533         commit.  All merging is assumed to have taken place\r
534         independently of <emphasis>git-svn</emphasis> functions.\r
535 </simpara>\r
536 </listitem>\r
537 </varlistentry>\r
538 <varlistentry>\r
539 <term>\r
540 <emphasis>create-ignore</emphasis>\r
541 </term>\r
542 <listitem>\r
543 <simpara>\r
544         Recursively finds the svn:ignore property on directories and\r
545         creates matching .gitignore files. The resulting files are staged to\r
546         be committed, but are not committed. Use -r/--revision to refer to a\r
547         specific revision.\r
548 </simpara>\r
549 </listitem>\r
550 </varlistentry>\r
551 <varlistentry>\r
552 <term>\r
553 <emphasis>show-ignore</emphasis>\r
554 </term>\r
555 <listitem>\r
556 <simpara>\r
557         Recursively finds and lists the svn:ignore property on\r
558         directories.  The output is suitable for appending to\r
559         the $GIT_DIR/info/exclude file.\r
560 </simpara>\r
561 </listitem>\r
562 </varlistentry>\r
563 <varlistentry>\r
564 <term>\r
565 <emphasis>commit-diff</emphasis>\r
566 </term>\r
567 <listitem>\r
568 <simpara>\r
569         Commits the diff of two tree-ish arguments from the\r
570         command-line.  This command does not rely on being inside an <literal>git-svn\r
571         init</literal>-ed repository.  This command takes three arguments, (a) the\r
572         original tree to diff against, (b) the new tree result, (c) the\r
573         URL of the target Subversion repository.  The final argument\r
574         (URL) may be omitted if you are working from a <emphasis>git-svn</emphasis>-aware\r
575         repository (that has been <literal>init</literal>-ed with <emphasis>git-svn</emphasis>).\r
576         The -r&lt;revision&gt; option is required for this.\r
577 </simpara>\r
578 </listitem>\r
579 </varlistentry>\r
580 <varlistentry>\r
581 <term>\r
582 <emphasis>info</emphasis>\r
583 </term>\r
584 <listitem>\r
585 <simpara>\r
586         Shows information about a file or directory similar to what\r
587         &#8216;svn info&#8217; provides.  Does not currently support a -r/--revision\r
588         argument.  Use the --url option to output only the value of the\r
589         <emphasis>URL:</emphasis> field.\r
590 </simpara>\r
591 </listitem>\r
592 </varlistentry>\r
593 <varlistentry>\r
594 <term>\r
595 <emphasis>proplist</emphasis>\r
596 </term>\r
597 <listitem>\r
598 <simpara>\r
599         Lists the properties stored in the Subversion repository about a\r
600         given file or directory.  Use -r/--revision to refer to a specific\r
601         Subversion revision.\r
602 </simpara>\r
603 </listitem>\r
604 </varlistentry>\r
605 <varlistentry>\r
606 <term>\r
607 <emphasis>propget</emphasis>\r
608 </term>\r
609 <listitem>\r
610 <simpara>\r
611         Gets the Subversion property given as the first argument, for a\r
612         file.  A specific revision can be specified with -r/--revision.\r
613 </simpara>\r
614 </listitem>\r
615 </varlistentry>\r
616 <varlistentry>\r
617 <term>\r
618 <emphasis>show-externals</emphasis>\r
619 </term>\r
620 <listitem>\r
621 <simpara>\r
622         Shows the Subversion externals.  Use -r/--revision to specify a\r
623         specific revision.\r
624 </simpara>\r
625 </listitem>\r
626 </varlistentry>\r
627 </variablelist>\r
628 </simplesect>\r
629 <simplesect id="_options">\r
630 <title>OPTIONS</title>\r
631 <variablelist>\r
632 <varlistentry>\r
633 <term>\r
634 --shared[={false|true|umask|group|all|world|everybody}]\r
635 </term>\r
636 <term>\r
637 --template=&lt;template_directory&gt;\r
638 </term>\r
639 <listitem>\r
640 <simpara>\r
641         Only used with the <emphasis>init</emphasis> command.\r
642         These are passed directly to <emphasis>git-init</emphasis>.\r
643 </simpara>\r
644 </listitem>\r
645 </varlistentry>\r
646 <varlistentry>\r
647 <term>\r
648 -r &lt;ARG&gt;\r
649 </term>\r
650 <term>\r
651 --revision &lt;ARG&gt;\r
652 </term>\r
653 <listitem>\r
654 <simpara>\r
655 Used with the <emphasis>fetch</emphasis> command.\r
656 </simpara>\r
657 </listitem>\r
658 </varlistentry>\r
659 </variablelist>\r
660 <simpara>This allows revision ranges for partial/cauterized history\r
661 to be supported.  $NUMBER, $NUMBER1:$NUMBER2 (numeric ranges),\r
662 $NUMBER:HEAD, and BASE:$NUMBER are all supported.</simpara>\r
663 <simpara>This can allow you to make partial mirrors when running fetch;\r
664 but is generally not recommended because history will be skipped\r
665 and lost.</simpara>\r
666 <variablelist>\r
667 <varlistentry>\r
668 <term>\r
670 </term>\r
671 <term>\r
672 --stdin\r
673 </term>\r
674 <listitem>\r
675 <simpara>\r
676 Only used with the <emphasis>set-tree</emphasis> command.\r
677 </simpara>\r
678 </listitem>\r
679 </varlistentry>\r
680 </variablelist>\r
681 <simpara>Read a list of commits from stdin and commit them in reverse\r
682 order.  Only the leading sha1 is read from each line, so\r
683 <emphasis>git-rev-list --pretty=oneline</emphasis> output can be used.</simpara>\r
684 <variablelist>\r
685 <varlistentry>\r
686 <term>\r
687 --rmdir\r
688 </term>\r
689 <listitem>\r
690 <simpara>\r
691 Only used with the <emphasis>dcommit</emphasis>, <emphasis>set-tree</emphasis> and <emphasis>commit-diff</emphasis> commands.\r
692 </simpara>\r
693 </listitem>\r
694 </varlistentry>\r
695 </variablelist>\r
696 <simpara>Remove directories from the SVN tree if there are no files left\r
697 behind.  SVN can version empty directories, and they are not\r
698 removed by default if there are no files left in them.  git\r
699 cannot version empty directories.  Enabling this flag will make\r
700 the commit to SVN act like git.</simpara>\r
701 <simpara>config key: svn.rmdir</simpara>\r
702 <variablelist>\r
703 <varlistentry>\r
704 <term>\r
705 -e\r
706 </term>\r
707 <term>\r
708 --edit\r
709 </term>\r
710 <listitem>\r
711 <simpara>\r
712 Only used with the <emphasis>dcommit</emphasis>, <emphasis>set-tree</emphasis> and <emphasis>commit-diff</emphasis> commands.\r
713 </simpara>\r
714 </listitem>\r
715 </varlistentry>\r
716 </variablelist>\r
717 <simpara>Edit the commit message before committing to SVN.  This is off by\r
718 default for objects that are commits, and forced on when committing\r
719 tree objects.</simpara>\r
720 <simpara>config key: svn.edit</simpara>\r
721 <variablelist>\r
722 <varlistentry>\r
723 <term>\r
724 -l&lt;num&gt;\r
725 </term>\r
726 <term>\r
727 --find-copies-harder\r
728 </term>\r
729 <listitem>\r
730 <simpara>\r
731 Only used with the <emphasis>dcommit</emphasis>, <emphasis>set-tree</emphasis> and <emphasis>commit-diff</emphasis> commands.\r
732 </simpara>\r
733 </listitem>\r
734 </varlistentry>\r
735 </variablelist>\r
736 <simpara>They are both passed directly to <emphasis>git-diff-tree</emphasis>; see\r
737 <xref linkend="git-diff-tree(1)"/> for more information.</simpara>\r
738 <blockquote>\r
739 <literallayout>config key: svn.l\r
740 config key: svn.findcopiesharder</literallayout>\r
741 </blockquote>\r
742 <variablelist>\r
743 <varlistentry>\r
744 <term>\r
745 -A&lt;filename&gt;\r
746 </term>\r
747 <term>\r
748 --authors-file=&lt;filename&gt;\r
749 </term>\r
750 <listitem>\r
751 <simpara>\r
752 Syntax is compatible with the file used by <emphasis>git-cvsimport</emphasis>:\r
753 </simpara>\r
754 </listitem>\r
755 </varlistentry>\r
756 </variablelist>\r
757 <literallayout>        loginname = Joe User &lt;user@example.com&gt;</literallayout>\r
758 <simpara>If this option is specified and <emphasis>git-svn</emphasis> encounters an SVN\r
759 committer name that does not exist in the authors-file, <emphasis>git-svn</emphasis>\r
760 will abort operation. The user will then have to add the\r
761 appropriate entry.  Re-running the previous <emphasis>git-svn</emphasis> command\r
762 after the authors-file is modified should continue operation.</simpara>\r
763 <simpara>config key: svn.authorsfile</simpara>\r
764 <variablelist>\r
765 <varlistentry>\r
766 <term>\r
767 -q\r
768 </term>\r
769 <term>\r
770 --quiet\r
771 </term>\r
772 <listitem>\r
773 <simpara>\r
774         Make <emphasis>git-svn</emphasis> less verbose.\r
775 </simpara>\r
776 </listitem>\r
777 </varlistentry>\r
778 <varlistentry>\r
779 <term>\r
780 --repack[=&lt;n&gt;]\r
781 </term>\r
782 <term>\r
783 --repack-flags=&lt;flags&gt;\r
784 </term>\r
785 <listitem>\r
786 <simpara>\r
787 These should help keep disk usage sane for large fetches\r
788 with many revisions.\r
789 </simpara>\r
790 </listitem>\r
791 </varlistentry>\r
792 </variablelist>\r
793 <simpara>--repack takes an optional argument for the number of revisions\r
794 to fetch before repacking.  This defaults to repacking every\r
795 1000 commits fetched if no argument is specified.</simpara>\r
796 <simpara>--repack-flags are passed directly to <emphasis>git-repack</emphasis>.</simpara>\r
797 <blockquote>\r
798 <literallayout>config key: svn.repack\r
799 config key: svn.repackflags</literallayout>\r
800 </blockquote>\r
801 <variablelist>\r
802 <varlistentry>\r
803 <term>\r
804 -m\r
805 </term>\r
806 <term>\r
807 --merge\r
808 </term>\r
809 <term>\r
810 -s&lt;strategy&gt;\r
811 </term>\r
812 <term>\r
813 --strategy=&lt;strategy&gt;\r
814 </term>\r
815 <listitem>\r
816 <simpara>\r
817 These are only used with the <emphasis>dcommit</emphasis> and <emphasis>rebase</emphasis> commands.\r
818 </simpara>\r
819 </listitem>\r
820 </varlistentry>\r
821 </variablelist>\r
822 <simpara>Passed directly to <emphasis>git-rebase</emphasis> when using <emphasis>dcommit</emphasis> if a\r
823 <emphasis>git-reset</emphasis> cannot be used (see <emphasis>dcommit</emphasis>).</simpara>\r
824 <variablelist>\r
825 <varlistentry>\r
826 <term>\r
827 -n\r
828 </term>\r
829 <term>\r
830 --dry-run\r
831 </term>\r
832 <listitem>\r
833 <simpara>\r
834 This can be used with the <emphasis>dcommit</emphasis>, <emphasis>rebase</emphasis>, <emphasis>branch</emphasis> and <emphasis>tag</emphasis>\r
835 commands.\r
836 </simpara>\r
837 </listitem>\r
838 </varlistentry>\r
839 </variablelist>\r
840 <simpara>For <emphasis>dcommit</emphasis>, print out the series of git arguments that would show\r
841 which diffs would be committed to SVN.</simpara>\r
842 <simpara>For <emphasis>rebase</emphasis>, display the local branch associated with the upstream svn\r
843 repository associated with the current branch and the URL of svn\r
844 repository that will be fetched from.</simpara>\r
845 <simpara>For <emphasis>branch</emphasis> and <emphasis>tag</emphasis>, display the urls that will be used for copying when\r
846 creating the branch or tag.</simpara>\r
847 </simplesect>\r
848 <simplesect id="_advanced_options">\r
849 <title>ADVANCED OPTIONS</title>\r
850 <variablelist>\r
851 <varlistentry>\r
852 <term>\r
853 -i&lt;GIT_SVN_ID&gt;\r
854 </term>\r
855 <term>\r
856 --id &lt;GIT_SVN_ID&gt;\r
857 </term>\r
858 <listitem>\r
859 <simpara>\r
860 This sets GIT_SVN_ID (instead of using the environment).  This\r
861 allows the user to override the default refname to fetch from\r
862 when tracking a single URL.  The <emphasis>log</emphasis> and <emphasis>dcommit</emphasis> commands\r
863 no longer require this switch as an argument.\r
864 </simpara>\r
865 </listitem>\r
866 </varlistentry>\r
867 <varlistentry>\r
868 <term>\r
869 -R&lt;remote name&gt;\r
870 </term>\r
871 <term>\r
872 --svn-remote &lt;remote name&gt;\r
873 </term>\r
874 <listitem>\r
875 <simpara>\r
876         Specify the [svn-remote "&lt;remote name&gt;"] section to use,\r
877         this allows SVN multiple repositories to be tracked.\r
878         Default: "svn"\r
879 </simpara>\r
880 </listitem>\r
881 </varlistentry>\r
882 <varlistentry>\r
883 <term>\r
884 --follow-parent\r
885 </term>\r
886 <listitem>\r
887 <simpara>\r
888         This is especially helpful when we&#8217;re tracking a directory\r
889         that has been moved around within the repository, or if we\r
890         started tracking a branch and never tracked the trunk it was\r
891         descended from. This feature is enabled by default, use\r
892         --no-follow-parent to disable it.\r
893 </simpara>\r
894 </listitem>\r
895 </varlistentry>\r
896 </variablelist>\r
897 <simpara>config key: svn.followparent</simpara>\r
898 </simplesect>\r
899 <simplesect id="_config_file_only_options">\r
900 <title>CONFIG FILE-ONLY OPTIONS</title>\r
901 <variablelist>\r
902 <varlistentry>\r
903 <term>\r
904 svn.noMetadata\r
905 </term>\r
906 <term>\r
907 svn-remote.&lt;name&gt;.noMetadata\r
908 </term>\r
909 <listitem>\r
910 <simpara>\r
911 This gets rid of the <emphasis>git-svn-id:</emphasis> lines at the end of every commit.\r
912 </simpara>\r
913 </listitem>\r
914 </varlistentry>\r
915 </variablelist>\r
916 <simpara>If you lose your .git/svn/git-svn/.rev_db file, <emphasis>git-svn</emphasis> will not\r
917 be able to rebuild it and you won&#8217;t be able to fetch again,\r
918 either.  This is fine for one-shot imports.</simpara>\r
919 <simpara>The <emphasis>git-svn log</emphasis> command will not work on repositories using\r
920 this, either.  Using this conflicts with the <emphasis>useSvmProps</emphasis>\r
921 option for (hopefully) obvious reasons.</simpara>\r
922 <variablelist>\r
923 <varlistentry>\r
924 <term>\r
925 svn.useSvmProps\r
926 </term>\r
927 <term>\r
928 svn-remote.&lt;name&gt;.useSvmProps\r
929 </term>\r
930 <listitem>\r
931 <simpara>\r
932 This allows <emphasis>git-svn</emphasis> to re-map repository URLs and UUIDs from\r
933 mirrors created using SVN::Mirror (or svk) for metadata.\r
934 </simpara>\r
935 </listitem>\r
936 </varlistentry>\r
937 </variablelist>\r
938 <simpara>If an SVN revision has a property, "svm:headrev", it is likely\r
939 that the revision was created by SVN::Mirror (also used by SVK).\r
940 The property contains a repository UUID and a revision.  We want\r
941 to make it look like we are mirroring the original URL, so\r
942 introduce a helper function that returns the original identity\r
943 URL and UUID, and use it when generating metadata in commit\r
944 messages.</simpara>\r
945 <variablelist>\r
946 <varlistentry>\r
947 <term>\r
948 svn.useSvnsyncProps\r
949 </term>\r
950 <term>\r
951 svn-remote.&lt;name&gt;.useSvnsyncprops\r
952 </term>\r
953 <listitem>\r
954 <simpara>\r
955         Similar to the useSvmProps option; this is for users\r
956         of the svnsync(1) command distributed with SVN 1.4.x and\r
957         later.\r
958 </simpara>\r
959 </listitem>\r
960 </varlistentry>\r
961 <varlistentry>\r
962 <term>\r
963 svn-remote.&lt;name&gt;.rewriteRoot\r
964 </term>\r
965 <listitem>\r
966 <simpara>\r
967         This allows users to create repositories from alternate\r
968         URLs.  For example, an administrator could run <emphasis>git-svn</emphasis> on the\r
969         server locally (accessing via file://) but wish to distribute\r
970         the repository with a public http:// or svn:// URL in the\r
971         metadata so users of it will see the public URL.\r
972 </simpara>\r
973 </listitem>\r
974 </varlistentry>\r
975 </variablelist>\r
976 <simpara>Since the noMetadata, rewriteRoot, useSvnsyncProps and useSvmProps\r
977 options all affect the metadata generated and used by <emphasis>git-svn</emphasis>; they\r
978 <emphasis role="strong">must</emphasis> be set in the configuration file before any history is imported\r
979 and these settings should never be changed once they are set.</simpara>\r
980 <simpara>Additionally, only one of these four options can be used per-svn-remote\r
981 section because they affect the <emphasis>git-svn-id:</emphasis> metadata line.</simpara>\r
982 </simplesect>\r
983 <simplesect id="_basic_examples">\r
984 <title>BASIC EXAMPLES</title>\r
985 <simpara>Tracking and contributing to the trunk of a Subversion-managed project:</simpara>\r
986 <literallayout># Clone a repo (like git clone):\r
987         git svn clone http://svn.example.com/project/trunk\r
988 # Enter the newly cloned directory:\r
989         cd trunk\r
990 # You should be on master branch, double-check with git-branch\r
991         git branch\r
992 # Do some work and commit locally to git:\r
993         git commit ...\r
994 # Something is committed to SVN, rebase your local changes against the\r
995 # latest changes in SVN:\r
996         git svn rebase\r
997 # Now commit your changes (that were committed previously using git) to SVN,\r
998 # as well as automatically updating your working HEAD:\r
999         git svn dcommit\r
1000 # Append svn:ignore settings to the default git exclude file:\r
1001         git svn show-ignore &gt;&gt; .git/info/exclude</literallayout>\r
1002 <simpara>Tracking and contributing to an entire Subversion-managed project\r
1003 (complete with a trunk, tags and branches):</simpara>\r
1004 <literallayout># Clone a repo (like git clone):\r
1005         git svn clone http://svn.example.com/project -T trunk -b branches -t tags\r
1006 # View all branches and tags you have cloned:\r
1007         git branch -r\r
1008 # Create a new branch in SVN\r
1009     git svn branch waldo\r
1010 # Reset your master to trunk (or any other branch, replacing 'trunk'\r
1011 # with the appropriate name):\r
1012         git reset --hard remotes/trunk\r
1013 # You may only dcommit to one branch/tag/trunk at a time.  The usage\r
1014 # of dcommit/rebase/show-ignore should be the same as above.</literallayout>\r
1015 <simpara>The initial <emphasis>git-svn clone</emphasis> can be quite time-consuming\r
1016 (especially for large Subversion repositories). If multiple\r
1017 people (or one person with multiple machines) want to use\r
1018 <emphasis>git-svn</emphasis> to interact with the same Subversion repository, you can\r
1019 do the initial <emphasis>git-svn clone</emphasis> to a repository on a server and\r
1020 have each person clone that repository with <emphasis>git-clone</emphasis>:</simpara>\r
1021 <literallayout># Do the initial import on a server\r
1022         ssh server "cd /pub &amp;&amp; git svn clone http://svn.example.com/project\r
1023 # Clone locally - make sure the refs/remotes/ space matches the server\r
1024         mkdir project\r
1025         cd project\r
1026         git init\r
1027         git remote add origin server:/pub/project\r
1028         git config --add remote.origin.fetch '+refs/remotes/*:refs/remotes/*'\r
1029         git fetch\r
1030 # Create a local branch from one of the branches just fetched\r
1031         git checkout -b master FETCH_HEAD\r
1032 # Initialize git-svn locally (be sure to use the same URL and -T/-b/-t options as were used on server)\r
1033         git svn init http://svn.example.com/project\r
1034 # Pull the latest changes from Subversion\r
1035         git svn rebase</literallayout>\r
1036 </simplesect>\r
1037 <simplesect id="_rebase_vs_pull_merge">\r
1038 <title>REBASE VS. PULL/MERGE</title>\r
1039 <simpara>Originally, <emphasis>git-svn</emphasis> recommended that the <emphasis>remotes/git-svn</emphasis> branch be\r
1040 pulled or merged from.  This is because the author favored\r
1041 <literal>git svn set-tree B</literal> to commit a single head rather than the\r
1042 <literal>git svn set-tree A..B</literal> notation to commit multiple commits.</simpara>\r
1043 <simpara>If you use &#8216;git svn set-tree A..B` to commit several diffs and you do\r
1044 not have the latest remotes/git-svn merged into my-branch, you should\r
1045 use <literal>git svn rebase</literal> to update your work branch instead of <literal>git pull</literal> or\r
1046 <literal>git merge</literal>.  <literal>pull</literal>/`merge&#8217; can cause non-linear history to be flattened\r
1047 when committing into SVN, which can lead to merge commits reversing\r
1048 previous commits in SVN.</simpara>\r
1049 </simplesect>\r
1050 <simplesect id="_design_philosophy">\r
1051 <title>DESIGN PHILOSOPHY</title>\r
1052 <simpara>Merge tracking in Subversion is lacking and doing branched development\r
1053 with Subversion can be cumbersome as a result.  While <emphasis>git-svn</emphasis> can track\r
1054 copy history (including branches and tags) for repositories adopting a\r
1055 standard layout, it cannot yet represent merge history that happened\r
1056 inside git back upstream to SVN users.  Therefore it is advised that\r
1057 users keep history as linear as possible inside git to ease\r
1058 compatibility with SVN (see the CAVEATS section below).</simpara>\r
1059 </simplesect>\r
1060 <simplesect id="_caveats">\r
1061 <title>CAVEATS</title>\r
1062 <simpara>For the sake of simplicity and interoperating with a less-capable system\r
1063 (SVN), it is recommended that all <emphasis>git-svn</emphasis> users clone, fetch and dcommit\r
1064 directly from the SVN server, and avoid all <emphasis>git-clone</emphasis>/<emphasis>pull</emphasis>/<emphasis>merge</emphasis>/<emphasis>push</emphasis>\r
1065 operations between git repositories and branches.  The recommended\r
1066 method of exchanging code between git branches and users is\r
1067 <emphasis>git-format-patch</emphasis> and <emphasis>git-am</emphasis>, or just 'dcommit&#8217;ing to the SVN repository.</simpara>\r
1068 <simpara>Running <emphasis>git-merge</emphasis> or <emphasis>git-pull</emphasis> is NOT recommended on a branch you\r
1069 plan to <emphasis>dcommit</emphasis> from.  Subversion does not represent merges in any\r
1070 reasonable or useful fashion; so users using Subversion cannot see any\r
1071 merges you&#8217;ve made.  Furthermore, if you merge or pull from a git branch\r
1072 that is a mirror of an SVN branch, <emphasis>dcommit</emphasis> may commit to the wrong\r
1073 branch.</simpara>\r
1074 <simpara><emphasis>git-clone</emphasis> does not clone branches under the refs/remotes/ hierarchy or\r
1075 any <emphasis>git-svn</emphasis> metadata, or config.  So repositories created and managed with\r
1076 using <emphasis>git-svn</emphasis> should use <emphasis>rsync</emphasis> for cloning, if cloning is to be done\r
1077 at all.</simpara>\r
1078 <simpara>Since <emphasis>dcommit</emphasis> uses rebase internally, any git branches you <emphasis>git-push</emphasis> to\r
1079 before <emphasis>dcommit</emphasis> on will require forcing an overwrite of the existing ref\r
1080 on the remote repository.  This is generally considered bad practice,\r
1081 see the <xref linkend="git-push(1)"/> documentation for details.</simpara>\r
1082 <simpara>Do not use the --amend option of <xref linkend="git-commit(1)"/> on a change you&#8217;ve\r
1083 already dcommitted.  It is considered bad practice to --amend commits\r
1084 you&#8217;ve already pushed to a remote repository for other users, and\r
1085 dcommit with SVN is analogous to that.</simpara>\r
1086 </simplesect>\r
1087 <simplesect id="_bugs">\r
1088 <title>BUGS</title>\r
1089 <simpara>We ignore all SVN properties except svn:executable.  Any unhandled\r
1090 properties are logged to $GIT_DIR/svn/&lt;refname&gt;/unhandled.log</simpara>\r
1091 <simpara>Renamed and copied directories are not detected by git and hence not\r
1092 tracked when committing to SVN.  I do not plan on adding support for\r
1093 this as it&#8217;s quite difficult and time-consuming to get working for all\r
1094 the possible corner cases (git doesn&#8217;t do it, either).  Committing\r
1095 renamed and copied files are fully supported if they&#8217;re similar enough\r
1096 for git to detect them.</simpara>\r
1097 </simplesect>\r
1098 <simplesect id="_configuration">\r
1099 <title>CONFIGURATION</title>\r
1100 <simpara><emphasis>git-svn</emphasis> stores [svn-remote] configuration information in the\r
1101 repository .git/config file.  It is similar the core git\r
1102 [remote] sections except <emphasis>fetch</emphasis> keys do not accept glob\r
1103 arguments; but they are instead handled by the <emphasis>branches</emphasis>\r
1104 and <emphasis>tags</emphasis> keys.  Since some SVN repositories are oddly\r
1105 configured with multiple projects glob expansions such those\r
1106 listed below are allowed:</simpara>\r
1107 <literallayout>[svn-remote "project-a"]\r
1108         url = http://server.org/svn\r
1109         branches = branches/*/project-a:refs/remotes/project-a/branches/*\r
1110         tags = tags/*/project-a:refs/remotes/project-a/tags/*\r
1111         trunk = trunk/project-a:refs/remotes/project-a/trunk</literallayout>\r
1112 <simpara>Keep in mind that the <emphasis><emphasis role="strong"></emphasis> (asterisk) wildcard of the local ref\r
1113 (right of the <emphasis>:</emphasis>) *must</emphasis> be the farthest right path component;\r
1114 however the remote wildcard may be anywhere as long as it&#8217;s own\r
1115 independent path component (surrounded by <emphasis>/</emphasis> or EOL).   This\r
1116 type of configuration is not automatically created by <emphasis>init</emphasis> and\r
1117 should be manually entered with a text-editor or using <emphasis>git-config</emphasis>.</simpara>\r
1118 </simplesect>\r
1119 <simplesect id="_see_also">\r
1120 <title>SEE ALSO</title>\r
1121 <simpara><xref linkend="git-rebase(1)"/></simpara>\r
1122 </simplesect>\r
1123 <simplesect id="_author">\r
1124 <title>Author</title>\r
1125 <simpara>Written by Eric Wong &lt;<ulink url="mailto:normalperson@yhbt.net">normalperson@yhbt.net</ulink>&gt;.</simpara>\r
1126 </simplesect>\r
1127 <simplesect id="_documentation">\r
1128 <title>Documentation</title>\r
1129 <simpara>Written by Eric Wong &lt;<ulink url="mailto:normalperson@yhbt.net">normalperson@yhbt.net</ulink>&gt;.</simpara>\r
1130 </simplesect>\r
1131 </article>\r