Autogenerated HTML docs for v1.7.5-134-g1c08
[git/jnareb-git.git] / git-svn.html
blobfd130b9670864ed7b20785b5f151c95f410c9495
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6 <meta name="generator" content="AsciiDoc 8.4.5" />
7 <title>git-svn(1)</title>
8 <style type="text/css">
9 /* Debug borders */
10 p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
12 border: 1px solid red;
16 body {
17 margin: 1em 5% 1em 5%;
20 a {
21 color: blue;
22 text-decoration: underline;
24 a:visited {
25 color: fuchsia;
28 em {
29 font-style: italic;
30 color: navy;
33 strong {
34 font-weight: bold;
35 color: #083194;
38 tt {
39 color: navy;
42 h1, h2, h3, h4, h5, h6 {
43 color: #527bbd;
44 font-family: sans-serif;
45 margin-top: 1.2em;
46 margin-bottom: 0.5em;
47 line-height: 1.3;
50 h1, h2, h3 {
51 border-bottom: 2px solid silver;
53 h2 {
54 padding-top: 0.5em;
56 h3 {
57 float: left;
59 h3 + * {
60 clear: left;
63 div.sectionbody {
64 font-family: serif;
65 margin-left: 0;
68 hr {
69 border: 1px solid silver;
72 p {
73 margin-top: 0.5em;
74 margin-bottom: 0.5em;
77 ul, ol, li > p {
78 margin-top: 0;
81 pre {
82 padding: 0;
83 margin: 0;
86 span#author {
87 color: #527bbd;
88 font-family: sans-serif;
89 font-weight: bold;
90 font-size: 1.1em;
92 span#email {
94 span#revnumber, span#revdate, span#revremark {
95 font-family: sans-serif;
98 div#footer {
99 font-family: sans-serif;
100 font-size: small;
101 border-top: 2px solid silver;
102 padding-top: 0.5em;
103 margin-top: 4.0em;
105 div#footer-text {
106 float: left;
107 padding-bottom: 0.5em;
109 div#footer-badges {
110 float: right;
111 padding-bottom: 0.5em;
114 div#preamble {
115 margin-top: 1.5em;
116 margin-bottom: 1.5em;
118 div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
119 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
120 div.admonitionblock {
121 margin-top: 1.5em;
122 margin-bottom: 1.5em;
124 div.admonitionblock {
125 margin-top: 2.5em;
126 margin-bottom: 2.5em;
129 div.content { /* Block element content. */
130 padding: 0;
133 /* Block element titles. */
134 div.title, caption.title {
135 color: #527bbd;
136 font-family: sans-serif;
137 font-weight: bold;
138 text-align: left;
139 margin-top: 1.0em;
140 margin-bottom: 0.5em;
142 div.title + * {
143 margin-top: 0;
146 td div.title:first-child {
147 margin-top: 0.0em;
149 div.content div.title:first-child {
150 margin-top: 0.0em;
152 div.content + div.title {
153 margin-top: 0.0em;
156 div.sidebarblock > div.content {
157 background: #ffffee;
158 border: 1px solid silver;
159 padding: 0.5em;
162 div.listingblock > div.content {
163 border: 1px solid silver;
164 background: #f4f4f4;
165 padding: 0.5em;
168 div.quoteblock {
169 padding-left: 2.0em;
170 margin-right: 10%;
172 div.quoteblock > div.attribution {
173 padding-top: 0.5em;
174 text-align: right;
177 div.verseblock {
178 padding-left: 2.0em;
179 margin-right: 10%;
181 div.verseblock > div.content {
182 white-space: pre;
184 div.verseblock > div.attribution {
185 padding-top: 0.75em;
186 text-align: left;
188 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
189 div.verseblock + div.attribution {
190 text-align: left;
193 div.admonitionblock .icon {
194 vertical-align: top;
195 font-size: 1.1em;
196 font-weight: bold;
197 text-decoration: underline;
198 color: #527bbd;
199 padding-right: 0.5em;
201 div.admonitionblock td.content {
202 padding-left: 0.5em;
203 border-left: 2px solid silver;
206 div.exampleblock > div.content {
207 border-left: 2px solid silver;
208 padding: 0.5em;
211 div.imageblock div.content { padding-left: 0; }
212 span.image img { border-style: none; }
213 a.image:visited { color: white; }
215 dl {
216 margin-top: 0.8em;
217 margin-bottom: 0.8em;
219 dt {
220 margin-top: 0.5em;
221 margin-bottom: 0;
222 font-style: normal;
223 color: navy;
225 dd > *:first-child {
226 margin-top: 0.1em;
229 ul, ol {
230 list-style-position: outside;
232 ol.arabic {
233 list-style-type: decimal;
235 ol.loweralpha {
236 list-style-type: lower-alpha;
238 ol.upperalpha {
239 list-style-type: upper-alpha;
241 ol.lowerroman {
242 list-style-type: lower-roman;
244 ol.upperroman {
245 list-style-type: upper-roman;
248 div.compact ul, div.compact ol,
249 div.compact p, div.compact p,
250 div.compact div, div.compact div {
251 margin-top: 0.1em;
252 margin-bottom: 0.1em;
255 div.tableblock > table {
256 border: 3px solid #527bbd;
258 thead {
259 font-family: sans-serif;
260 font-weight: bold;
262 tfoot {
263 font-weight: bold;
265 td > div.verse {
266 white-space: pre;
268 p.table {
269 margin-top: 0;
271 /* Because the table frame attribute is overriden by CSS in most browsers. */
272 div.tableblock > table[frame="void"] {
273 border-style: none;
275 div.tableblock > table[frame="hsides"] {
276 border-left-style: none;
277 border-right-style: none;
279 div.tableblock > table[frame="vsides"] {
280 border-top-style: none;
281 border-bottom-style: none;
285 div.hdlist {
286 margin-top: 0.8em;
287 margin-bottom: 0.8em;
289 div.hdlist tr {
290 padding-bottom: 15px;
292 dt.hdlist1.strong, td.hdlist1.strong {
293 font-weight: bold;
295 td.hdlist1 {
296 vertical-align: top;
297 font-style: normal;
298 padding-right: 0.8em;
299 color: navy;
301 td.hdlist2 {
302 vertical-align: top;
304 div.hdlist.compact tr {
305 margin: 0;
306 padding-bottom: 0;
309 .comment {
310 background: yellow;
313 @media print {
314 div#footer-badges { display: none; }
317 div#toctitle {
318 color: #527bbd;
319 font-family: sans-serif;
320 font-size: 1.1em;
321 font-weight: bold;
322 margin-top: 1.0em;
323 margin-bottom: 0.1em;
326 div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
327 margin-top: 0;
328 margin-bottom: 0;
330 div.toclevel2 {
331 margin-left: 2em;
332 font-size: 0.9em;
334 div.toclevel3 {
335 margin-left: 4em;
336 font-size: 0.9em;
338 div.toclevel4 {
339 margin-left: 6em;
340 font-size: 0.9em;
342 /* Overrides for manpage documents */
343 h1 {
344 padding-top: 0.5em;
345 padding-bottom: 0.5em;
346 border-top: 2px solid silver;
347 border-bottom: 2px solid silver;
349 h2 {
350 border-style: none;
352 div.sectionbody {
353 margin-left: 5%;
356 @media print {
357 div#toc { display: none; }
360 /* Workarounds for IE6's broken and incomplete CSS2. */
362 div.sidebar-content {
363 background: #ffffee;
364 border: 1px solid silver;
365 padding: 0.5em;
367 div.sidebar-title, div.image-title {
368 color: #527bbd;
369 font-family: sans-serif;
370 font-weight: bold;
371 margin-top: 0.0em;
372 margin-bottom: 0.5em;
375 div.listingblock div.content {
376 border: 1px solid silver;
377 background: #f4f4f4;
378 padding: 0.5em;
381 div.quoteblock-attribution {
382 padding-top: 0.5em;
383 text-align: right;
386 div.verseblock-content {
387 white-space: pre;
389 div.verseblock-attribution {
390 padding-top: 0.75em;
391 text-align: left;
394 div.exampleblock-content {
395 border-left: 2px solid silver;
396 padding-left: 0.5em;
399 /* IE6 sets dynamically generated links as visited. */
400 div#toc a:visited { color: blue; }
401 </style>
402 </head>
403 <body>
404 <div id="header">
405 <h1>
406 git-svn(1) Manual Page
407 </h1>
408 <h2>NAME</h2>
409 <div class="sectionbody">
410 <p>git-svn -
411 Bidirectional operation between a Subversion repository and git
412 </p>
413 </div>
414 </div>
415 <h2 id="_synopsis">SYNOPSIS</h2>
416 <div class="sectionbody">
417 <div class="paragraph"><p><em>git svn</em> &lt;command&gt; [options] [arguments]</p></div>
418 </div>
419 <h2 id="_description">DESCRIPTION</h2>
420 <div class="sectionbody">
421 <div class="paragraph"><p><em>git svn</em> is a simple conduit for changesets between Subversion and git.
422 It provides a bidirectional flow of changes between a Subversion and a git
423 repository.</p></div>
424 <div class="paragraph"><p><em>git svn</em> can track a standard Subversion repository,
425 following the common "trunk/branches/tags" layout, with the --stdlayout option.
426 It can also follow branches and tags in any layout with the -T/-t/-b options
427 (see options to <em>init</em> below, and also the <em>clone</em> command).</p></div>
428 <div class="paragraph"><p>Once tracking a Subversion repository (with any of the above methods), the git
429 repository can be updated from Subversion by the <em>fetch</em> command and
430 Subversion updated from git by the <em>dcommit</em> command.</p></div>
431 </div>
432 <h2 id="_commands">COMMANDS</h2>
433 <div class="sectionbody">
434 <div class="dlist"><dl>
435 <dt class="hdlist1">
436 <em>init</em>
437 </dt>
438 <dd>
440 Initializes an empty git repository with additional
441 metadata directories for <em>git svn</em>. The Subversion URL
442 may be specified as a command-line argument, or as full
443 URL arguments to -T/-t/-b. Optionally, the target
444 directory to operate on can be specified as a second
445 argument. Normally this command initializes the current
446 directory.
447 </p>
448 <div class="dlist"><dl>
449 <dt class="hdlist1">
450 -T&lt;trunk_subdir&gt;
451 </dt>
452 <dt class="hdlist1">
453 --trunk=&lt;trunk_subdir&gt;
454 </dt>
455 <dt class="hdlist1">
456 -t&lt;tags_subdir&gt;
457 </dt>
458 <dt class="hdlist1">
459 --tags=&lt;tags_subdir&gt;
460 </dt>
461 <dt class="hdlist1">
462 -b&lt;branches_subdir&gt;
463 </dt>
464 <dt class="hdlist1">
465 --branches=&lt;branches_subdir&gt;
466 </dt>
467 <dt class="hdlist1">
469 </dt>
470 <dt class="hdlist1">
471 --stdlayout
472 </dt>
473 <dd>
475 These are optional command-line options for init. Each of
476 these flags can point to a relative repository path
477 (--tags=project/tags) or a full url
478 (--tags=https://foo.org/project/tags).
479 You can specify more than one --tags and/or --branches options, in case
480 your Subversion repository places tags or branches under multiple paths.
481 The option --stdlayout is
482 a shorthand way of setting trunk,tags,branches as the relative paths,
483 which is the Subversion default. If any of the other options are given
484 as well, they take precedence.
485 </p>
486 </dd>
487 <dt class="hdlist1">
488 --no-metadata
489 </dt>
490 <dd>
492 Set the <em>noMetadata</em> option in the [svn-remote] config.
493 This option is not recommended, please read the <em>svn.noMetadata</em>
494 section of this manpage before using this option.
495 </p>
496 </dd>
497 <dt class="hdlist1">
498 --use-svm-props
499 </dt>
500 <dd>
502 Set the <em>useSvmProps</em> option in the [svn-remote] config.
503 </p>
504 </dd>
505 <dt class="hdlist1">
506 --use-svnsync-props
507 </dt>
508 <dd>
510 Set the <em>useSvnsyncProps</em> option in the [svn-remote] config.
511 </p>
512 </dd>
513 <dt class="hdlist1">
514 --rewrite-root=&lt;URL&gt;
515 </dt>
516 <dd>
518 Set the <em>rewriteRoot</em> option in the [svn-remote] config.
519 </p>
520 </dd>
521 <dt class="hdlist1">
522 --rewrite-uuid=&lt;UUID&gt;
523 </dt>
524 <dd>
526 Set the <em>rewriteUUID</em> option in the [svn-remote] config.
527 </p>
528 </dd>
529 <dt class="hdlist1">
530 --username=&lt;user&gt;
531 </dt>
532 <dd>
534 For transports that SVN handles authentication for (http,
535 https, and plain svn), specify the username. For other
536 transports (eg svn+ssh://), you must include the username in
537 the URL, eg svn+ssh://foo@svn.bar.com/project
538 </p>
539 </dd>
540 <dt class="hdlist1">
541 --prefix=&lt;prefix&gt;
542 </dt>
543 <dd>
545 This allows one to specify a prefix which is prepended
546 to the names of remotes if trunk/branches/tags are
547 specified. The prefix does not automatically include a
548 trailing slash, so be sure you include one in the
549 argument if that is what you want. If --branches/-b is
550 specified, the prefix must include a trailing slash.
551 Setting a prefix is useful if you wish to track multiple
552 projects that share a common repository.
553 </p>
554 </dd>
555 <dt class="hdlist1">
556 --ignore-paths=&lt;regex&gt;
557 </dt>
558 <dd>
560 When passed to <em>init</em> or <em>clone</em> this regular expression will
561 be preserved as a config key. See <em>fetch</em> for a description
562 of <em>--ignore-paths</em>.
563 </p>
564 </dd>
565 <dt class="hdlist1">
566 --no-minimize-url
567 </dt>
568 <dd>
570 When tracking multiple directories (using --stdlayout,
571 --branches, or --tags options), git svn will attempt to connect
572 to the root (or highest allowed level) of the Subversion
573 repository. This default allows better tracking of history if
574 entire projects are moved within a repository, but may cause
575 issues on repositories where read access restrictions are in
576 place. Passing <em>--no-minimize-url</em> will allow git svn to
577 accept URLs as-is without attempting to connect to a higher
578 level directory. This option is off by default when only
579 one URL/branch is tracked (it would do little good).
580 </p>
581 </dd>
582 </dl></div>
583 </dd>
584 <dt class="hdlist1">
585 <em>fetch</em>
586 </dt>
587 <dd>
589 Fetch unfetched revisions from the Subversion remote we are
590 tracking. The name of the [svn-remote "&#8230;"] section in the
591 .git/config file may be specified as an optional command-line
592 argument.
593 </p>
594 <div class="dlist"><dl>
595 <dt class="hdlist1">
596 --localtime
597 </dt>
598 <dd>
600 Store Git commit times in the local timezone instead of UTC. This
601 makes <em>git log</em> (even without --date=local) show the same times
602 that <tt>svn log</tt> would in the local timezone.
603 </p>
604 <div class="paragraph"><p>This doesn&#8217;t interfere with interoperating with the Subversion
605 repository you cloned from, but if you wish for your local Git
606 repository to be able to interoperate with someone else&#8217;s local Git
607 repository, either don&#8217;t use this option or you should both use it in
608 the same local timezone.</p></div>
609 </dd>
610 <dt class="hdlist1">
611 --parent
612 </dt>
613 <dd>
615 Fetch only from the SVN parent of the current HEAD.
616 </p>
617 </dd>
618 <dt class="hdlist1">
619 --ignore-paths=&lt;regex&gt;
620 </dt>
621 <dd>
623 This allows one to specify a Perl regular expression that will
624 cause skipping of all matching paths from checkout from SVN.
625 The <em>--ignore-paths</em> option should match for every <em>fetch</em>
626 (including automatic fetches due to <em>clone</em>, <em>dcommit</em>,
627 <em>rebase</em>, etc) on a given repository.
628 </p>
629 <div class="verseblock">
630 <div class="verseblock-content">config key: svn-remote.&lt;name&gt;.ignore-paths</div>
631 <div class="verseblock-attribution">
632 </div></div>
633 <div class="paragraph"><p>If the ignore-paths config key is set and the command line option is
634 also given, both regular expressions will be used.</p></div>
635 <div class="paragraph"><p>Examples:</p></div>
636 <div class="dlist"><dl>
637 <dt class="hdlist1">
638 Skip "doc*" directory for every fetch
639 </dt>
640 <dd>
641 <div class="listingblock">
642 <div class="content">
643 <pre><tt>--ignore-paths="^doc"</tt></pre>
644 </div></div>
645 </dd>
646 <dt class="hdlist1">
647 Skip "branches" and "tags" of first level directories
648 </dt>
649 <dd>
650 <div class="listingblock">
651 <div class="content">
652 <pre><tt>--ignore-paths="^[^/]+/(?:branches|tags)"</tt></pre>
653 </div></div>
654 </dd>
655 </dl></div>
656 </dd>
657 <dt class="hdlist1">
658 --use-log-author
659 </dt>
660 <dd>
662 When retrieving svn commits into git (as part of fetch, rebase, or
663 dcommit operations), look for the first From: or Signed-off-by: line
664 in the log message and use that as the author string.
665 </p>
666 </dd>
667 <dt class="hdlist1">
668 --add-author-from
669 </dt>
670 <dd>
672 When committing to svn from git (as part of commit or dcommit
673 operations), if the existing log message doesn&#8217;t already have a
674 From: or Signed-off-by: line, append a From: line based on the
675 git commit&#8217;s author string. If you use this, then --use-log-author
676 will retrieve a valid author string for all commits.
677 </p>
678 </dd>
679 </dl></div>
680 </dd>
681 <dt class="hdlist1">
682 <em>clone</em>
683 </dt>
684 <dd>
686 Runs <em>init</em> and <em>fetch</em>. It will automatically create a
687 directory based on the basename of the URL passed to it;
688 or if a second argument is passed; it will create a directory
689 and work within that. It accepts all arguments that the
690 <em>init</em> and <em>fetch</em> commands accept; with the exception of
691 <em>--fetch-all</em> and <em>--parent</em>. After a repository is cloned,
692 the <em>fetch</em> command will be able to update revisions without
693 affecting the working tree; and the <em>rebase</em> command will be
694 able to update the working tree with the latest changes.
695 </p>
696 </dd>
697 <dt class="hdlist1">
698 <em>rebase</em>
699 </dt>
700 <dd>
702 This fetches revisions from the SVN parent of the current HEAD
703 and rebases the current (uncommitted to SVN) work against it.
704 </p>
705 <div class="paragraph"><p>This works similarly to <tt>svn update</tt> or <em>git pull</em> except that
706 it preserves linear history with <em>git rebase</em> instead of
707 <em>git merge</em> for ease of dcommitting with <em>git svn</em>.</p></div>
708 <div class="paragraph"><p>This accepts all options that <em>git svn fetch</em> and <em>git rebase</em>
709 accept. However, <em>--fetch-all</em> only fetches from the current
710 [svn-remote], and not all [svn-remote] definitions.</p></div>
711 <div class="paragraph"><p>Like <em>git rebase</em>; this requires that the working tree be clean
712 and have no uncommitted changes.</p></div>
713 <div class="dlist"><dl>
714 <dt class="hdlist1">
716 </dt>
717 <dt class="hdlist1">
718 --local
719 </dt>
720 <dd>
722 Do not fetch remotely; only run <em>git rebase</em> against the
723 last fetched commit from the upstream SVN.
724 </p>
725 </dd>
726 </dl></div>
727 </dd>
728 <dt class="hdlist1">
729 <em>dcommit</em>
730 </dt>
731 <dd>
733 Commit each diff from a specified head directly to the SVN
734 repository, and then rebase or reset (depending on whether or
735 not there is a diff between SVN and head). This will create
736 a revision in SVN for each commit in git.
737 It is recommended that you run <em>git svn</em> fetch and rebase (not
738 pull or merge) your commits against the latest changes in the
739 SVN repository.
740 An optional revision or branch argument may be specified, and
741 causes <em>git svn</em> to do all work on that revision/branch
742 instead of HEAD.
743 This is advantageous over <em>set-tree</em> (below) because it produces
744 cleaner, more linear history.
745 </p>
746 <div class="dlist"><dl>
747 <dt class="hdlist1">
748 --no-rebase
749 </dt>
750 <dd>
752 After committing, do not rebase or reset.
753 </p>
754 </dd>
755 <dt class="hdlist1">
756 --commit-url &lt;URL&gt;
757 </dt>
758 <dd>
760 Commit to this SVN URL (the full path). This is intended to
761 allow existing <em>git svn</em> repositories created with one transport
762 method (e.g. <tt>svn://</tt> or <tt>http://</tt> for anonymous read) to be
763 reused if a user is later given access to an alternate transport
764 method (e.g. <tt>svn+ssh://</tt> or <tt>https://</tt>) for commit.
765 </p>
766 <div class="verseblock">
767 <div class="verseblock-content">config key: svn-remote.&lt;name&gt;.commiturl
768 config key: svn.commiturl (overwrites all svn-remote.&lt;name&gt;.commiturl options)</div>
769 <div class="verseblock-attribution">
770 </div></div>
771 <div class="paragraph"><p>Using this option for any other purpose (don&#8217;t ask) is very strongly
772 discouraged.</p></div>
773 </dd>
774 <dt class="hdlist1">
775 --mergeinfo=&lt;mergeinfo&gt;
776 </dt>
777 <dd>
779 Add the given merge information during the dcommit
780 (e.g. <tt>--mergeinfo="/branches/foo:1-10"</tt>). All svn server versions can
781 store this information (as a property), and svn clients starting from
782 version 1.5 can make use of it. <em>git svn</em> currently does not use it
783 and does not set it automatically.
784 </p>
785 </dd>
786 </dl></div>
787 </dd>
788 <dt class="hdlist1">
789 <em>branch</em>
790 </dt>
791 <dd>
793 Create a branch in the SVN repository.
794 </p>
795 <div class="dlist"><dl>
796 <dt class="hdlist1">
798 </dt>
799 <dt class="hdlist1">
800 --message
801 </dt>
802 <dd>
804 Allows to specify the commit message.
805 </p>
806 </dd>
807 <dt class="hdlist1">
809 </dt>
810 <dt class="hdlist1">
811 --tag
812 </dt>
813 <dd>
815 Create a tag by using the tags_subdir instead of the branches_subdir
816 specified during git svn init.
817 </p>
818 </dd>
819 <dt class="hdlist1">
821 </dt>
822 <dt class="hdlist1">
823 --destination
824 </dt>
825 <dd>
827 If more than one --branches (or --tags) option was given to the <em>init</em>
828 or <em>clone</em> command, you must provide the location of the branch (or
829 tag) you wish to create in the SVN repository. The value of this
830 option must match one of the paths specified by a --branches (or
831 --tags) option. You can see these paths with the commands
832 </p>
833 <div class="literalblock">
834 <div class="content">
835 <pre><tt>git config --get-all svn-remote.&lt;name&gt;.branches
836 git config --get-all svn-remote.&lt;name&gt;.tags</tt></pre>
837 </div></div>
838 <div class="paragraph"><p>where &lt;name&gt; is the name of the SVN repository as specified by the -R option to
839 <em>init</em> (or "svn" by default).</p></div>
840 </dd>
841 <dt class="hdlist1">
842 --username
843 </dt>
844 <dd>
846 Specify the SVN username to perform the commit as. This option overrides
847 the <em>username</em> configuration property.
848 </p>
849 </dd>
850 <dt class="hdlist1">
851 --commit-url
852 </dt>
853 <dd>
855 Use the specified URL to connect to the destination Subversion
856 repository. This is useful in cases where the source SVN
857 repository is read-only. This option overrides configuration
858 property <em>commiturl</em>.
859 </p>
860 <div class="literalblock">
861 <div class="content">
862 <pre><tt>git config --get-all svn-remote.&lt;name&gt;.commiturl</tt></pre>
863 </div></div>
864 </dd>
865 </dl></div>
866 </dd>
867 <dt class="hdlist1">
868 <em>tag</em>
869 </dt>
870 <dd>
872 Create a tag in the SVN repository. This is a shorthand for
873 <em>branch -t</em>.
874 </p>
875 </dd>
876 <dt class="hdlist1">
877 <em>log</em>
878 </dt>
879 <dd>
881 This should make it easy to look up svn log messages when svn
882 users refer to -r/--revision numbers.
883 </p>
884 <div class="paragraph"><p>The following features from &#8216;svn log&#8217; are supported:</p></div>
885 <div class="dlist"><dl>
886 <dt class="hdlist1">
887 -r &lt;n&gt;[:&lt;n&gt;]
888 </dt>
889 <dt class="hdlist1">
890 --revision=&lt;n&gt;[:&lt;n&gt;]
891 </dt>
892 <dd>
894 is supported, non-numeric args are not:
895 HEAD, NEXT, BASE, PREV, etc &#8230;
896 </p>
897 </dd>
898 <dt class="hdlist1">
900 </dt>
901 <dt class="hdlist1">
902 --verbose
903 </dt>
904 <dd>
906 it&#8217;s not completely compatible with the --verbose
907 output in svn log, but reasonably close.
908 </p>
909 </dd>
910 <dt class="hdlist1">
911 --limit=&lt;n&gt;
912 </dt>
913 <dd>
915 is NOT the same as --max-count, doesn&#8217;t count
916 merged/excluded commits
917 </p>
918 </dd>
919 <dt class="hdlist1">
920 --incremental
921 </dt>
922 <dd>
924 supported
925 </p>
926 </dd>
927 </dl></div>
928 <div class="paragraph"><p>New features:</p></div>
929 <div class="dlist"><dl>
930 <dt class="hdlist1">
931 --show-commit
932 </dt>
933 <dd>
935 shows the git commit sha1, as well
936 </p>
937 </dd>
938 <dt class="hdlist1">
939 --oneline
940 </dt>
941 <dd>
943 our version of --pretty=oneline
944 </p>
945 </dd>
946 </dl></div>
947 <div class="admonitionblock">
948 <table><tr>
949 <td class="icon">
950 <div class="title">Note</div>
951 </td>
952 <td class="content">SVN itself only stores times in UTC and nothing else. The regular svn
953 client converts the UTC time to the local time (or based on the TZ=
954 environment). This command has the same behaviour.</td>
955 </tr></table>
956 </div>
957 <div class="paragraph"><p>Any other arguments are passed directly to <em>git log</em></p></div>
958 </dd>
959 <dt class="hdlist1">
960 <em>blame</em>
961 </dt>
962 <dd>
964 Show what revision and author last modified each line of a file. The
965 output of this mode is format-compatible with the output of
966 &#8216;svn blame&#8217; by default. Like the SVN blame command,
967 local uncommitted changes in the working copy are ignored;
968 the version of the file in the HEAD revision is annotated. Unknown
969 arguments are passed directly to <em>git blame</em>.
970 </p>
971 <div class="dlist"><dl>
972 <dt class="hdlist1">
973 --git-format
974 </dt>
975 <dd>
977 Produce output in the same format as <em>git blame</em>, but with
978 SVN revision numbers instead of git commit hashes. In this mode,
979 changes that haven&#8217;t been committed to SVN (including local
980 working-copy edits) are shown as revision 0.
981 </p>
982 </dd>
983 </dl></div>
984 </dd>
985 <dt class="hdlist1">
986 <em>find-rev</em>
987 </dt>
988 <dd>
990 When given an SVN revision number of the form <em>rN</em>, returns the
991 corresponding git commit hash (this can optionally be followed by a
992 tree-ish to specify which branch should be searched). When given a
993 tree-ish, returns the corresponding SVN revision number.
994 </p>
995 </dd>
996 <dt class="hdlist1">
997 <em>set-tree</em>
998 </dt>
999 <dd>
1001 You should consider using <em>dcommit</em> instead of this command.
1002 Commit specified commit or tree objects to SVN. This relies on
1003 your imported fetch data being up-to-date. This makes
1004 absolutely no attempts to do patching when committing to SVN, it
1005 simply overwrites files with those specified in the tree or
1006 commit. All merging is assumed to have taken place
1007 independently of <em>git svn</em> functions.
1008 </p>
1009 </dd>
1010 <dt class="hdlist1">
1011 <em>create-ignore</em>
1012 </dt>
1013 <dd>
1015 Recursively finds the svn:ignore property on directories and
1016 creates matching .gitignore files. The resulting files are staged to
1017 be committed, but are not committed. Use -r/--revision to refer to a
1018 specific revision.
1019 </p>
1020 </dd>
1021 <dt class="hdlist1">
1022 <em>show-ignore</em>
1023 </dt>
1024 <dd>
1026 Recursively finds and lists the svn:ignore property on
1027 directories. The output is suitable for appending to
1028 the $GIT_DIR/info/exclude file.
1029 </p>
1030 </dd>
1031 <dt class="hdlist1">
1032 <em>mkdirs</em>
1033 </dt>
1034 <dd>
1036 Attempts to recreate empty directories that core git cannot track
1037 based on information in $GIT_DIR/svn/&lt;refname&gt;/unhandled.log files.
1038 Empty directories are automatically recreated when using
1039 "git svn clone" and "git svn rebase", so "mkdirs" is intended
1040 for use after commands like "git checkout" or "git reset".
1041 (See the svn-remote.&lt;name&gt;.automkdirs config file option for
1042 more information.)
1043 </p>
1044 </dd>
1045 <dt class="hdlist1">
1046 <em>commit-diff</em>
1047 </dt>
1048 <dd>
1050 Commits the diff of two tree-ish arguments from the
1051 command-line. This command does not rely on being inside an <tt>git svn
1052 init</tt>-ed repository. This command takes three arguments, (a) the
1053 original tree to diff against, (b) the new tree result, (c) the
1054 URL of the target Subversion repository. The final argument
1055 (URL) may be omitted if you are working from a <em>git svn</em>-aware
1056 repository (that has been <tt>init</tt>-ed with <em>git svn</em>).
1057 The -r&lt;revision&gt; option is required for this.
1058 </p>
1059 </dd>
1060 <dt class="hdlist1">
1061 <em>info</em>
1062 </dt>
1063 <dd>
1065 Shows information about a file or directory similar to what
1066 &#8216;svn info&#8217; provides. Does not currently support a -r/--revision
1067 argument. Use the --url option to output only the value of the
1068 <em>URL:</em> field.
1069 </p>
1070 </dd>
1071 <dt class="hdlist1">
1072 <em>proplist</em>
1073 </dt>
1074 <dd>
1076 Lists the properties stored in the Subversion repository about a
1077 given file or directory. Use -r/--revision to refer to a specific
1078 Subversion revision.
1079 </p>
1080 </dd>
1081 <dt class="hdlist1">
1082 <em>propget</em>
1083 </dt>
1084 <dd>
1086 Gets the Subversion property given as the first argument, for a
1087 file. A specific revision can be specified with -r/--revision.
1088 </p>
1089 </dd>
1090 <dt class="hdlist1">
1091 <em>show-externals</em>
1092 </dt>
1093 <dd>
1095 Shows the Subversion externals. Use -r/--revision to specify a
1096 specific revision.
1097 </p>
1098 </dd>
1099 <dt class="hdlist1">
1100 <em>gc</em>
1101 </dt>
1102 <dd>
1104 Compress $GIT_DIR/svn/&lt;refname&gt;/unhandled.log files in .git/svn
1105 and remove $GIT_DIR/svn/&lt;refname&gt;index files in .git/svn.
1106 </p>
1107 </dd>
1108 <dt class="hdlist1">
1109 <em>reset</em>
1110 </dt>
1111 <dd>
1113 Undoes the effects of <em>fetch</em> back to the specified revision.
1114 This allows you to re-<em>fetch</em> an SVN revision. Normally the
1115 contents of an SVN revision should never change and <em>reset</em>
1116 should not be necessary. However, if SVN permissions change,
1117 or if you alter your --ignore-paths option, a <em>fetch</em> may fail
1118 with "not found in commit" (file not previously visible) or
1119 "checksum mismatch" (missed a modification). If the problem
1120 file cannot be ignored forever (with --ignore-paths) the only
1121 way to repair the repo is to use <em>reset</em>.
1122 </p>
1123 <div class="paragraph"><p>Only the rev_map and refs/remotes/git-svn are changed. Follow <em>reset</em>
1124 with a <em>fetch</em> and then <em>git reset</em> or <em>git rebase</em> to move local
1125 branches onto the new tree.</p></div>
1126 <div class="dlist"><dl>
1127 <dt class="hdlist1">
1128 -r &lt;n&gt;
1129 </dt>
1130 <dt class="hdlist1">
1131 --revision=&lt;n&gt;
1132 </dt>
1133 <dd>
1135 Specify the most recent revision to keep. All later revisions
1136 are discarded.
1137 </p>
1138 </dd>
1139 <dt class="hdlist1">
1141 </dt>
1142 <dt class="hdlist1">
1143 --parent
1144 </dt>
1145 <dd>
1147 Discard the specified revision as well, keeping the nearest
1148 parent instead.
1149 </p>
1150 </dd>
1151 <dt class="hdlist1">
1152 Example:
1153 </dt>
1154 <dd>
1156 Assume you have local changes in "master", but you need to refetch "r2".
1157 </p>
1158 <div class="listingblock">
1159 <div class="content">
1160 <pre><tt> r1---r2---r3 remotes/git-svn
1162 A---B master</tt></pre>
1163 </div></div>
1164 <div class="paragraph"><p>Fix the ignore-paths or SVN permissions problem that caused "r2" to
1165 be incomplete in the first place. Then:</p></div>
1166 <div class="verseblock">
1167 <div class="verseblock-content">git svn reset -r2 -p
1168 git svn fetch</div>
1169 <div class="verseblock-attribution">
1170 </div></div>
1171 <div class="listingblock">
1172 <div class="content">
1173 <pre><tt> r1---r2'--r3' remotes/git-svn
1175 r2---r3---A---B master</tt></pre>
1176 </div></div>
1177 <div class="paragraph"><p>Then fixup "master" with <em>git rebase</em>.
1178 Do NOT use <em>git merge</em> or your history will not be compatible with a
1179 future <em>dcommit</em>!</p></div>
1180 <div class="verseblock">
1181 <div class="verseblock-content">git rebase --onto remotes/git-svn A^ master</div>
1182 <div class="verseblock-attribution">
1183 </div></div>
1184 <div class="listingblock">
1185 <div class="content">
1186 <pre><tt> r1---r2'--r3' remotes/git-svn
1188 A'--B' master</tt></pre>
1189 </div></div>
1190 </dd>
1191 </dl></div>
1192 </dd>
1193 </dl></div>
1194 </div>
1195 <h2 id="_options">OPTIONS</h2>
1196 <div class="sectionbody">
1197 <div class="dlist"><dl>
1198 <dt class="hdlist1">
1199 --shared[=(false|true|umask|group|all|world|everybody)]
1200 </dt>
1201 <dt class="hdlist1">
1202 --template=&lt;template_directory&gt;
1203 </dt>
1204 <dd>
1206 Only used with the <em>init</em> command.
1207 These are passed directly to <em>git init</em>.
1208 </p>
1209 </dd>
1210 <dt class="hdlist1">
1211 -r &lt;arg&gt;
1212 </dt>
1213 <dt class="hdlist1">
1214 --revision &lt;arg&gt;
1215 </dt>
1216 <dd>
1218 Used with the <em>fetch</em> command.
1219 </p>
1220 <div class="paragraph"><p>This allows revision ranges for partial/cauterized history
1221 to be supported. $NUMBER, $NUMBER1:$NUMBER2 (numeric ranges),
1222 $NUMBER:HEAD, and BASE:$NUMBER are all supported.</p></div>
1223 <div class="paragraph"><p>This can allow you to make partial mirrors when running fetch;
1224 but is generally not recommended because history will be skipped
1225 and lost.</p></div>
1226 </dd>
1227 <dt class="hdlist1">
1229 </dt>
1230 <dt class="hdlist1">
1231 --stdin
1232 </dt>
1233 <dd>
1235 Only used with the <em>set-tree</em> command.
1236 </p>
1237 <div class="paragraph"><p>Read a list of commits from stdin and commit them in reverse
1238 order. Only the leading sha1 is read from each line, so
1239 <em>git rev-list --pretty=oneline</em> output can be used.</p></div>
1240 </dd>
1241 <dt class="hdlist1">
1242 --rmdir
1243 </dt>
1244 <dd>
1246 Only used with the <em>dcommit</em>, <em>set-tree</em> and <em>commit-diff</em> commands.
1247 </p>
1248 <div class="paragraph"><p>Remove directories from the SVN tree if there are no files left
1249 behind. SVN can version empty directories, and they are not
1250 removed by default if there are no files left in them. git
1251 cannot version empty directories. Enabling this flag will make
1252 the commit to SVN act like git.</p></div>
1253 <div class="verseblock">
1254 <div class="verseblock-content">config key: svn.rmdir</div>
1255 <div class="verseblock-attribution">
1256 </div></div>
1257 </dd>
1258 <dt class="hdlist1">
1260 </dt>
1261 <dt class="hdlist1">
1262 --edit
1263 </dt>
1264 <dd>
1266 Only used with the <em>dcommit</em>, <em>set-tree</em> and <em>commit-diff</em> commands.
1267 </p>
1268 <div class="paragraph"><p>Edit the commit message before committing to SVN. This is off by
1269 default for objects that are commits, and forced on when committing
1270 tree objects.</p></div>
1271 <div class="verseblock">
1272 <div class="verseblock-content">config key: svn.edit</div>
1273 <div class="verseblock-attribution">
1274 </div></div>
1275 </dd>
1276 <dt class="hdlist1">
1277 -l&lt;num&gt;
1278 </dt>
1279 <dt class="hdlist1">
1280 --find-copies-harder
1281 </dt>
1282 <dd>
1284 Only used with the <em>dcommit</em>, <em>set-tree</em> and <em>commit-diff</em> commands.
1285 </p>
1286 <div class="paragraph"><p>They are both passed directly to <em>git diff-tree</em>; see
1287 <a href="git-diff-tree.html">git-diff-tree(1)</a> for more information.</p></div>
1288 <div class="verseblock">
1289 <div class="verseblock-content">config key: svn.l
1290 config key: svn.findcopiesharder</div>
1291 <div class="verseblock-attribution">
1292 </div></div>
1293 </dd>
1294 <dt class="hdlist1">
1295 -A&lt;filename&gt;
1296 </dt>
1297 <dt class="hdlist1">
1298 --authors-file=&lt;filename&gt;
1299 </dt>
1300 <dd>
1302 Syntax is compatible with the file used by <em>git cvsimport</em>:
1303 </p>
1304 <div class="listingblock">
1305 <div class="content">
1306 <pre><tt> loginname = Joe User &lt;user@example.com&gt;</tt></pre>
1307 </div></div>
1308 <div class="paragraph"><p>If this option is specified and <em>git svn</em> encounters an SVN
1309 committer name that does not exist in the authors-file, <em>git svn</em>
1310 will abort operation. The user will then have to add the
1311 appropriate entry. Re-running the previous <em>git svn</em> command
1312 after the authors-file is modified should continue operation.</p></div>
1313 <div class="verseblock">
1314 <div class="verseblock-content">config key: svn.authorsfile</div>
1315 <div class="verseblock-attribution">
1316 </div></div>
1317 </dd>
1318 <dt class="hdlist1">
1319 --authors-prog=&lt;filename&gt;
1320 </dt>
1321 <dd>
1323 If this option is specified, for each SVN committer name that
1324 does not exist in the authors file, the given file is executed
1325 with the committer name as the first argument. The program is
1326 expected to return a single line of the form "Name &lt;email&gt;",
1327 which will be treated as if included in the authors file.
1328 </p>
1329 </dd>
1330 <dt class="hdlist1">
1332 </dt>
1333 <dt class="hdlist1">
1334 --quiet
1335 </dt>
1336 <dd>
1338 Make <em>git svn</em> less verbose. Specify a second time to make it
1339 even less verbose.
1340 </p>
1341 </dd>
1342 <dt class="hdlist1">
1343 --repack[=&lt;n&gt;]
1344 </dt>
1345 <dt class="hdlist1">
1346 --repack-flags=&lt;flags&gt;
1347 </dt>
1348 <dd>
1350 These should help keep disk usage sane for large fetches with
1351 many revisions.
1352 </p>
1353 <div class="paragraph"><p>--repack takes an optional argument for the number of revisions
1354 to fetch before repacking. This defaults to repacking every
1355 1000 commits fetched if no argument is specified.</p></div>
1356 <div class="paragraph"><p>--repack-flags are passed directly to <em>git repack</em>.</p></div>
1357 <div class="verseblock">
1358 <div class="verseblock-content">config key: svn.repack
1359 config key: svn.repackflags</div>
1360 <div class="verseblock-attribution">
1361 </div></div>
1362 </dd>
1363 <dt class="hdlist1">
1365 </dt>
1366 <dt class="hdlist1">
1367 --merge
1368 </dt>
1369 <dt class="hdlist1">
1370 -s&lt;strategy&gt;
1371 </dt>
1372 <dt class="hdlist1">
1373 --strategy=&lt;strategy&gt;
1374 </dt>
1375 <dd>
1377 These are only used with the <em>dcommit</em> and <em>rebase</em> commands.
1378 </p>
1379 <div class="paragraph"><p>Passed directly to <em>git rebase</em> when using <em>dcommit</em> if a
1380 <em>git reset</em> cannot be used (see <em>dcommit</em>).</p></div>
1381 </dd>
1382 <dt class="hdlist1">
1384 </dt>
1385 <dt class="hdlist1">
1386 --dry-run
1387 </dt>
1388 <dd>
1390 This can be used with the <em>dcommit</em>, <em>rebase</em>, <em>branch</em> and
1391 <em>tag</em> commands.
1392 </p>
1393 <div class="paragraph"><p>For <em>dcommit</em>, print out the series of git arguments that would show
1394 which diffs would be committed to SVN.</p></div>
1395 <div class="paragraph"><p>For <em>rebase</em>, display the local branch associated with the upstream svn
1396 repository associated with the current branch and the URL of svn
1397 repository that will be fetched from.</p></div>
1398 <div class="paragraph"><p>For <em>branch</em> and <em>tag</em>, display the urls that will be used for copying when
1399 creating the branch or tag.</p></div>
1400 </dd>
1401 </dl></div>
1402 </div>
1403 <h2 id="_advanced_options">ADVANCED OPTIONS</h2>
1404 <div class="sectionbody">
1405 <div class="dlist"><dl>
1406 <dt class="hdlist1">
1407 -i&lt;GIT_SVN_ID&gt;
1408 </dt>
1409 <dt class="hdlist1">
1410 --id &lt;GIT_SVN_ID&gt;
1411 </dt>
1412 <dd>
1414 This sets GIT_SVN_ID (instead of using the environment). This
1415 allows the user to override the default refname to fetch from
1416 when tracking a single URL. The <em>log</em> and <em>dcommit</em> commands
1417 no longer require this switch as an argument.
1418 </p>
1419 </dd>
1420 <dt class="hdlist1">
1421 -R&lt;remote name&gt;
1422 </dt>
1423 <dt class="hdlist1">
1424 --svn-remote &lt;remote name&gt;
1425 </dt>
1426 <dd>
1428 Specify the [svn-remote "&lt;remote name&gt;"] section to use,
1429 this allows SVN multiple repositories to be tracked.
1430 Default: "svn"
1431 </p>
1432 </dd>
1433 <dt class="hdlist1">
1434 --follow-parent
1435 </dt>
1436 <dd>
1438 This is especially helpful when we&#8217;re tracking a directory
1439 that has been moved around within the repository, or if we
1440 started tracking a branch and never tracked the trunk it was
1441 descended from. This feature is enabled by default, use
1442 --no-follow-parent to disable it.
1443 </p>
1444 <div class="verseblock">
1445 <div class="verseblock-content">config key: svn.followparent</div>
1446 <div class="verseblock-attribution">
1447 </div></div>
1448 </dd>
1449 </dl></div>
1450 </div>
1451 <h2 id="_config_file_only_options">CONFIG FILE-ONLY OPTIONS</h2>
1452 <div class="sectionbody">
1453 <div class="dlist"><dl>
1454 <dt class="hdlist1">
1455 svn.noMetadata
1456 </dt>
1457 <dt class="hdlist1">
1458 svn-remote.&lt;name&gt;.noMetadata
1459 </dt>
1460 <dd>
1462 This gets rid of the <em>git-svn-id:</em> lines at the end of every commit.
1463 </p>
1464 <div class="paragraph"><p>This option can only be used for one-shot imports as <em>git svn</em>
1465 will not be able to fetch again without metadata. Additionally,
1466 if you lose your .git/svn/<strong>*/.rev_map.</strong> files, <em>git svn</em> will not
1467 be able to rebuild them.</p></div>
1468 <div class="paragraph"><p>The <em>git svn log</em> command will not work on repositories using
1469 this, either. Using this conflicts with the <em>useSvmProps</em>
1470 option for (hopefully) obvious reasons.</p></div>
1471 <div class="paragraph"><p>This option is NOT recommended as it makes it difficult to track down
1472 old references to SVN revision numbers in existing documentation, bug
1473 reports and archives. If you plan to eventually migrate from SVN to git
1474 and are certain about dropping SVN history, consider
1475 <a href="git-filter-branch.html">git-filter-branch(1)</a> instead. filter-branch also allows
1476 reformatting of metadata for ease-of-reading and rewriting authorship
1477 info for non-"svn.authorsFile" users.</p></div>
1478 </dd>
1479 <dt class="hdlist1">
1480 svn.useSvmProps
1481 </dt>
1482 <dt class="hdlist1">
1483 svn-remote.&lt;name&gt;.useSvmProps
1484 </dt>
1485 <dd>
1487 This allows <em>git svn</em> to re-map repository URLs and UUIDs from
1488 mirrors created using SVN::Mirror (or svk) for metadata.
1489 </p>
1490 <div class="paragraph"><p>If an SVN revision has a property, "svm:headrev", it is likely
1491 that the revision was created by SVN::Mirror (also used by SVK).
1492 The property contains a repository UUID and a revision. We want
1493 to make it look like we are mirroring the original URL, so
1494 introduce a helper function that returns the original identity
1495 URL and UUID, and use it when generating metadata in commit
1496 messages.</p></div>
1497 </dd>
1498 <dt class="hdlist1">
1499 svn.useSvnsyncProps
1500 </dt>
1501 <dt class="hdlist1">
1502 svn-remote.&lt;name&gt;.useSvnsyncprops
1503 </dt>
1504 <dd>
1506 Similar to the useSvmProps option; this is for users
1507 of the svnsync(1) command distributed with SVN 1.4.x and
1508 later.
1509 </p>
1510 </dd>
1511 <dt class="hdlist1">
1512 svn-remote.&lt;name&gt;.rewriteRoot
1513 </dt>
1514 <dd>
1516 This allows users to create repositories from alternate
1517 URLs. For example, an administrator could run <em>git svn</em> on the
1518 server locally (accessing via file://) but wish to distribute
1519 the repository with a public http:// or svn:// URL in the
1520 metadata so users of it will see the public URL.
1521 </p>
1522 </dd>
1523 <dt class="hdlist1">
1524 svn-remote.&lt;name&gt;.rewriteUUID
1525 </dt>
1526 <dd>
1528 Similar to the useSvmProps option; this is for users who need
1529 to remap the UUID manually. This may be useful in situations
1530 where the original UUID is not available via either useSvmProps
1531 or useSvnsyncProps.
1532 </p>
1533 </dd>
1534 <dt class="hdlist1">
1535 svn-remote.&lt;name&gt;.pushurl
1536 </dt>
1537 <dd>
1539 Similar to git&#8217;s <em>remote.&lt;name&gt;.pushurl</em>, this key is designed
1540 to be used in cases where <em>url</em> points to an SVN repository
1541 via a read-only transport, to provide an alternate read/write
1542 transport. It is assumed that both keys point to the same
1543 repository. Unlike <em>commiturl</em>, <em>pushurl</em> is a base path. If
1544 either <em>commiturl</em> or <em>pushurl</em> could be used, <em>commiturl</em>
1545 takes precedence.
1546 </p>
1547 </dd>
1548 <dt class="hdlist1">
1549 svn.brokenSymlinkWorkaround
1550 </dt>
1551 <dd>
1553 This disables potentially expensive checks to workaround
1554 broken symlinks checked into SVN by broken clients. Set this
1555 option to "false" if you track a SVN repository with many
1556 empty blobs that are not symlinks. This option may be changed
1557 while <em>git svn</em> is running and take effect on the next
1558 revision fetched. If unset, <em>git svn</em> assumes this option to
1559 be "true".
1560 </p>
1561 </dd>
1562 <dt class="hdlist1">
1563 svn.pathnameencoding
1564 </dt>
1565 <dd>
1567 This instructs git svn to recode pathnames to a given encoding.
1568 It can be used by windows users and by those who work in non-utf8
1569 locales to avoid corrupted file names with non-ASCII characters.
1570 Valid encodings are the ones supported by Perl&#8217;s Encode module.
1571 </p>
1572 </dd>
1573 <dt class="hdlist1">
1574 svn-remote.&lt;name&gt;.automkdirs
1575 </dt>
1576 <dd>
1578 Normally, the "git svn clone" and "git svn rebase" commands
1579 attempt to recreate empty directories that are in the
1580 Subversion repository. If this option is set to "false", then
1581 empty directories will only be created if the "git svn mkdirs"
1582 command is run explicitly. If unset, <em>git svn</em> assumes this
1583 option to be "true".
1584 </p>
1585 </dd>
1586 </dl></div>
1587 <div class="paragraph"><p>Since the noMetadata, rewriteRoot, rewriteUUID, useSvnsyncProps and useSvmProps
1588 options all affect the metadata generated and used by <em>git svn</em>; they
1589 <strong>must</strong> be set in the configuration file before any history is imported
1590 and these settings should never be changed once they are set.</p></div>
1591 <div class="paragraph"><p>Additionally, only one of these options can be used per svn-remote
1592 section because they affect the <em>git-svn-id:</em> metadata line, except
1593 for rewriteRoot and rewriteUUID which can be used together.</p></div>
1594 </div>
1595 <h2 id="_basic_examples">BASIC EXAMPLES</h2>
1596 <div class="sectionbody">
1597 <div class="paragraph"><p>Tracking and contributing to the trunk of a Subversion-managed project:</p></div>
1598 <div class="listingblock">
1599 <div class="content">
1600 <pre><tt># Clone a repo (like git clone):
1601 git svn clone http://svn.example.com/project/trunk
1602 # Enter the newly cloned directory:
1603 cd trunk
1604 # You should be on master branch, double-check with 'git branch'
1605 git branch
1606 # Do some work and commit locally to git:
1607 git commit ...
1608 # Something is committed to SVN, rebase your local changes against the
1609 # latest changes in SVN:
1610 git svn rebase
1611 # Now commit your changes (that were committed previously using git) to SVN,
1612 # as well as automatically updating your working HEAD:
1613 git svn dcommit
1614 # Append svn:ignore settings to the default git exclude file:
1615 git svn show-ignore &gt;&gt; .git/info/exclude</tt></pre>
1616 </div></div>
1617 <div class="paragraph"><p>Tracking and contributing to an entire Subversion-managed project
1618 (complete with a trunk, tags and branches):</p></div>
1619 <div class="listingblock">
1620 <div class="content">
1621 <pre><tt># Clone a repo (like git clone):
1622 git svn clone http://svn.example.com/project -T trunk -b branches -t tags
1623 # View all branches and tags you have cloned:
1624 git branch -r
1625 # Create a new branch in SVN
1626 git svn branch waldo
1627 # Reset your master to trunk (or any other branch, replacing 'trunk'
1628 # with the appropriate name):
1629 git reset --hard remotes/trunk
1630 # You may only dcommit to one branch/tag/trunk at a time. The usage
1631 # of dcommit/rebase/show-ignore should be the same as above.</tt></pre>
1632 </div></div>
1633 <div class="paragraph"><p>The initial <em>git svn clone</em> can be quite time-consuming
1634 (especially for large Subversion repositories). If multiple
1635 people (or one person with multiple machines) want to use
1636 <em>git svn</em> to interact with the same Subversion repository, you can
1637 do the initial <em>git svn clone</em> to a repository on a server and
1638 have each person clone that repository with <em>git clone</em>:</p></div>
1639 <div class="listingblock">
1640 <div class="content">
1641 <pre><tt># Do the initial import on a server
1642 ssh server "cd /pub &amp;&amp; git svn clone http://svn.example.com/project
1643 # Clone locally - make sure the refs/remotes/ space matches the server
1644 mkdir project
1645 cd project
1646 git init
1647 git remote add origin server:/pub/project
1648 git config --replace-all remote.origin.fetch '+refs/remotes/*:refs/remotes/*'
1649 git fetch
1650 # Prevent fetch/pull from remote git server in the future,
1651 # we only want to use git svn for future updates
1652 git config --remove-section remote.origin
1653 # Create a local branch from one of the branches just fetched
1654 git checkout -b master FETCH_HEAD
1655 # Initialize 'git svn' locally (be sure to use the same URL and -T/-b/-t options as were used on server)
1656 git svn init http://svn.example.com/project
1657 # Pull the latest changes from Subversion
1658 git svn rebase</tt></pre>
1659 </div></div>
1660 </div>
1661 <h2 id="_rebase_vs_pull_merge">REBASE VS. PULL/MERGE</h2>
1662 <div class="sectionbody">
1663 <div class="paragraph"><p>Originally, <em>git svn</em> recommended that the <em>remotes/git-svn</em> branch be
1664 pulled or merged from. This is because the author favored
1665 <tt>git svn set-tree B</tt> to commit a single head rather than the
1666 <tt>git svn set-tree A..B</tt> notation to commit multiple commits.</p></div>
1667 <div class="paragraph"><p>If you use <tt>git svn set-tree A..B</tt> to commit several diffs and you do
1668 not have the latest remotes/git-svn merged into my-branch, you should
1669 use <tt>git svn rebase</tt> to update your work branch instead of <tt>git pull</tt> or
1670 <tt>git merge</tt>. <tt>pull</tt>/<tt>merge</tt> can cause non-linear history to be flattened
1671 when committing into SVN, which can lead to merge commits reversing
1672 previous commits in SVN.</p></div>
1673 </div>
1674 <h2 id="_design_philosophy">DESIGN PHILOSOPHY</h2>
1675 <div class="sectionbody">
1676 <div class="paragraph"><p>Merge tracking in Subversion is lacking and doing branched development
1677 with Subversion can be cumbersome as a result. While <em>git svn</em> can track
1678 copy history (including branches and tags) for repositories adopting a
1679 standard layout, it cannot yet represent merge history that happened
1680 inside git back upstream to SVN users. Therefore it is advised that
1681 users keep history as linear as possible inside git to ease
1682 compatibility with SVN (see the CAVEATS section below).</p></div>
1683 </div>
1684 <h2 id="_caveats">CAVEATS</h2>
1685 <div class="sectionbody">
1686 <div class="paragraph"><p>For the sake of simplicity and interoperating with a less-capable system
1687 (SVN), it is recommended that all <em>git svn</em> users clone, fetch and dcommit
1688 directly from the SVN server, and avoid all <em>git clone</em>/<em>pull</em>/<em>merge</em>/<em>push</em>
1689 operations between git repositories and branches. The recommended
1690 method of exchanging code between git branches and users is
1691 <em>git format-patch</em> and <em>git am</em>, or just 'dcommit&#8217;ing to the SVN repository.</p></div>
1692 <div class="paragraph"><p>Running <em>git merge</em> or <em>git pull</em> is NOT recommended on a branch you
1693 plan to <em>dcommit</em> from. Subversion does not represent merges in any
1694 reasonable or useful fashion; so users using Subversion cannot see any
1695 merges you&#8217;ve made. Furthermore, if you merge or pull from a git branch
1696 that is a mirror of an SVN branch, <em>dcommit</em> may commit to the wrong
1697 branch.</p></div>
1698 <div class="paragraph"><p>If you do merge, note the following rule: <em>git svn dcommit</em> will
1699 attempt to commit on top of the SVN commit named in</p></div>
1700 <div class="listingblock">
1701 <div class="content">
1702 <pre><tt>git log --grep=^git-svn-id: --first-parent -1</tt></pre>
1703 </div></div>
1704 <div class="paragraph"><p>You <em>must</em> therefore ensure that the most recent commit of the branch
1705 you want to dcommit to is the <em>first</em> parent of the merge. Chaos will
1706 ensue otherwise, especially if the first parent is an older commit on
1707 the same SVN branch.</p></div>
1708 <div class="paragraph"><p><em>git clone</em> does not clone branches under the refs/remotes/ hierarchy or
1709 any <em>git svn</em> metadata, or config. So repositories created and managed with
1710 using <em>git svn</em> should use <em>rsync</em> for cloning, if cloning is to be done
1711 at all.</p></div>
1712 <div class="paragraph"><p>Since <em>dcommit</em> uses rebase internally, any git branches you <em>git push</em> to
1713 before <em>dcommit</em> on will require forcing an overwrite of the existing ref
1714 on the remote repository. This is generally considered bad practice,
1715 see the <a href="git-push.html">git-push(1)</a> documentation for details.</p></div>
1716 <div class="paragraph"><p>Do not use the --amend option of <a href="git-commit.html">git-commit(1)</a> on a change you&#8217;ve
1717 already dcommitted. It is considered bad practice to --amend commits
1718 you&#8217;ve already pushed to a remote repository for other users, and
1719 dcommit with SVN is analogous to that.</p></div>
1720 <div class="paragraph"><p>When using multiple --branches or --tags, <em>git svn</em> does not automatically
1721 handle name collisions (for example, if two branches from different paths have
1722 the same name, or if a branch and a tag have the same name). In these cases,
1723 use <em>init</em> to set up your git repository then, before your first <em>fetch</em>, edit
1724 the .git/config file so that the branches and tags are associated with
1725 different name spaces. For example:</p></div>
1726 <div class="literalblock">
1727 <div class="content">
1728 <pre><tt>branches = stable/*:refs/remotes/svn/stable/*
1729 branches = debug/*:refs/remotes/svn/debug/*</tt></pre>
1730 </div></div>
1731 </div>
1732 <h2 id="_bugs">BUGS</h2>
1733 <div class="sectionbody">
1734 <div class="paragraph"><p>We ignore all SVN properties except svn:executable. Any unhandled
1735 properties are logged to $GIT_DIR/svn/&lt;refname&gt;/unhandled.log</p></div>
1736 <div class="paragraph"><p>Renamed and copied directories are not detected by git and hence not
1737 tracked when committing to SVN. I do not plan on adding support for
1738 this as it&#8217;s quite difficult and time-consuming to get working for all
1739 the possible corner cases (git doesn&#8217;t do it, either). Committing
1740 renamed and copied files are fully supported if they&#8217;re similar enough
1741 for git to detect them.</p></div>
1742 </div>
1743 <h2 id="_configuration">CONFIGURATION</h2>
1744 <div class="sectionbody">
1745 <div class="paragraph"><p><em>git svn</em> stores [svn-remote] configuration information in the
1746 repository .git/config file. It is similar the core git
1747 [remote] sections except <em>fetch</em> keys do not accept glob
1748 arguments; but they are instead handled by the <em>branches</em>
1749 and <em>tags</em> keys. Since some SVN repositories are oddly
1750 configured with multiple projects glob expansions such those
1751 listed below are allowed:</p></div>
1752 <div class="listingblock">
1753 <div class="content">
1754 <pre><tt>[svn-remote "project-a"]
1755 url = http://server.org/svn
1756 fetch = trunk/project-a:refs/remotes/project-a/trunk
1757 branches = branches/*/project-a:refs/remotes/project-a/branches/*
1758 tags = tags/*/project-a:refs/remotes/project-a/tags/*</tt></pre>
1759 </div></div>
1760 <div class="paragraph"><p>Keep in mind that the <em>*</em> (asterisk) wildcard of the local ref
1761 (right of the <em>:</em>) <strong>must</strong> be the farthest right path component;
1762 however the remote wildcard may be anywhere as long as it&#8217;s an
1763 independent path component (surrounded by <em>/</em> or EOL). This
1764 type of configuration is not automatically created by <em>init</em> and
1765 should be manually entered with a text-editor or using <em>git config</em>.</p></div>
1766 <div class="paragraph"><p>It is also possible to fetch a subset of branches or tags by using a
1767 comma-separated list of names within braces. For example:</p></div>
1768 <div class="listingblock">
1769 <div class="content">
1770 <pre><tt>[svn-remote "huge-project"]
1771 url = http://server.org/svn
1772 fetch = trunk/src:refs/remotes/trunk
1773 branches = branches/{red,green}/src:refs/remotes/branches/*
1774 tags = tags/{1.0,2.0}/src:refs/remotes/tags/*</tt></pre>
1775 </div></div>
1776 <div class="paragraph"><p>Note that git-svn keeps track of the highest revision in which a branch
1777 or tag has appeared. If the subset of branches or tags is changed after
1778 fetching, then .git/svn/.metadata must be manually edited to remove (or
1779 reset) branches-maxRev and/or tags-maxRev as appropriate.</p></div>
1780 </div>
1781 <h2 id="_see_also">SEE ALSO</h2>
1782 <div class="sectionbody">
1783 <div class="paragraph"><p><a href="git-rebase.html">git-rebase(1)</a></p></div>
1784 </div>
1785 <h2 id="_git">GIT</h2>
1786 <div class="sectionbody">
1787 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
1788 </div>
1789 <div id="footer">
1790 <div id="footer-text">
1791 Last updated 2011-04-27 21:09:28 UTC
1792 </div>
1793 </div>
1794 </body>
1795 </html>