Autogenerated HTML docs for v1.7.6-549-gf85a0
[git/jnareb-git.git] / git-svn.html
blob1af80eb4b10aa4a555f798f45fe20e905e3a4e04
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="verseblock">
418 <div class="verseblock-content"><em>git svn</em> &lt;command&gt; [options] [arguments]</div>
419 <div class="verseblock-attribution">
420 </div></div>
421 </div>
422 <h2 id="_description">DESCRIPTION</h2>
423 <div class="sectionbody">
424 <div class="paragraph"><p><em>git svn</em> is a simple conduit for changesets between Subversion and git.
425 It provides a bidirectional flow of changes between a Subversion and a git
426 repository.</p></div>
427 <div class="paragraph"><p><em>git svn</em> can track a standard Subversion repository,
428 following the common "trunk/branches/tags" layout, with the --stdlayout option.
429 It can also follow branches and tags in any layout with the -T/-t/-b options
430 (see options to <em>init</em> below, and also the <em>clone</em> command).</p></div>
431 <div class="paragraph"><p>Once tracking a Subversion repository (with any of the above methods), the git
432 repository can be updated from Subversion by the <em>fetch</em> command and
433 Subversion updated from git by the <em>dcommit</em> command.</p></div>
434 </div>
435 <h2 id="_commands">COMMANDS</h2>
436 <div class="sectionbody">
437 <div class="dlist"><dl>
438 <dt class="hdlist1">
439 <em>init</em>
440 </dt>
441 <dd>
443 Initializes an empty git repository with additional
444 metadata directories for <em>git svn</em>. The Subversion URL
445 may be specified as a command-line argument, or as full
446 URL arguments to -T/-t/-b. Optionally, the target
447 directory to operate on can be specified as a second
448 argument. Normally this command initializes the current
449 directory.
450 </p>
451 <div class="dlist"><dl>
452 <dt class="hdlist1">
453 -T&lt;trunk_subdir&gt;
454 </dt>
455 <dt class="hdlist1">
456 --trunk=&lt;trunk_subdir&gt;
457 </dt>
458 <dt class="hdlist1">
459 -t&lt;tags_subdir&gt;
460 </dt>
461 <dt class="hdlist1">
462 --tags=&lt;tags_subdir&gt;
463 </dt>
464 <dt class="hdlist1">
465 -b&lt;branches_subdir&gt;
466 </dt>
467 <dt class="hdlist1">
468 --branches=&lt;branches_subdir&gt;
469 </dt>
470 <dt class="hdlist1">
472 </dt>
473 <dt class="hdlist1">
474 --stdlayout
475 </dt>
476 <dd>
478 These are optional command-line options for init. Each of
479 these flags can point to a relative repository path
480 (--tags=project/tags) or a full url
481 (--tags=https://foo.org/project/tags).
482 You can specify more than one --tags and/or --branches options, in case
483 your Subversion repository places tags or branches under multiple paths.
484 The option --stdlayout is
485 a shorthand way of setting trunk,tags,branches as the relative paths,
486 which is the Subversion default. If any of the other options are given
487 as well, they take precedence.
488 </p>
489 </dd>
490 <dt class="hdlist1">
491 --no-metadata
492 </dt>
493 <dd>
495 Set the <em>noMetadata</em> option in the [svn-remote] config.
496 This option is not recommended, please read the <em>svn.noMetadata</em>
497 section of this manpage before using this option.
498 </p>
499 </dd>
500 <dt class="hdlist1">
501 --use-svm-props
502 </dt>
503 <dd>
505 Set the <em>useSvmProps</em> option in the [svn-remote] config.
506 </p>
507 </dd>
508 <dt class="hdlist1">
509 --use-svnsync-props
510 </dt>
511 <dd>
513 Set the <em>useSvnsyncProps</em> option in the [svn-remote] config.
514 </p>
515 </dd>
516 <dt class="hdlist1">
517 --rewrite-root=&lt;URL&gt;
518 </dt>
519 <dd>
521 Set the <em>rewriteRoot</em> option in the [svn-remote] config.
522 </p>
523 </dd>
524 <dt class="hdlist1">
525 --rewrite-uuid=&lt;UUID&gt;
526 </dt>
527 <dd>
529 Set the <em>rewriteUUID</em> option in the [svn-remote] config.
530 </p>
531 </dd>
532 <dt class="hdlist1">
533 --username=&lt;user&gt;
534 </dt>
535 <dd>
537 For transports that SVN handles authentication for (http,
538 https, and plain svn), specify the username. For other
539 transports (eg svn+ssh://), you must include the username in
540 the URL, eg svn+ssh://foo@svn.bar.com/project
541 </p>
542 </dd>
543 <dt class="hdlist1">
544 --prefix=&lt;prefix&gt;
545 </dt>
546 <dd>
548 This allows one to specify a prefix which is prepended
549 to the names of remotes if trunk/branches/tags are
550 specified. The prefix does not automatically include a
551 trailing slash, so be sure you include one in the
552 argument if that is what you want. If --branches/-b is
553 specified, the prefix must include a trailing slash.
554 Setting a prefix is useful if you wish to track multiple
555 projects that share a common repository.
556 </p>
557 </dd>
558 <dt class="hdlist1">
559 --ignore-paths=&lt;regex&gt;
560 </dt>
561 <dd>
563 When passed to <em>init</em> or <em>clone</em> this regular expression will
564 be preserved as a config key. See <em>fetch</em> for a description
565 of <em>--ignore-paths</em>.
566 </p>
567 </dd>
568 <dt class="hdlist1">
569 --no-minimize-url
570 </dt>
571 <dd>
573 When tracking multiple directories (using --stdlayout,
574 --branches, or --tags options), git svn will attempt to connect
575 to the root (or highest allowed level) of the Subversion
576 repository. This default allows better tracking of history if
577 entire projects are moved within a repository, but may cause
578 issues on repositories where read access restrictions are in
579 place. Passing <em>--no-minimize-url</em> will allow git svn to
580 accept URLs as-is without attempting to connect to a higher
581 level directory. This option is off by default when only
582 one URL/branch is tracked (it would do little good).
583 </p>
584 </dd>
585 </dl></div>
586 </dd>
587 <dt class="hdlist1">
588 <em>fetch</em>
589 </dt>
590 <dd>
592 Fetch unfetched revisions from the Subversion remote we are
593 tracking. The name of the [svn-remote "&#8230;"] section in the
594 .git/config file may be specified as an optional command-line
595 argument.
596 </p>
597 <div class="dlist"><dl>
598 <dt class="hdlist1">
599 --localtime
600 </dt>
601 <dd>
603 Store Git commit times in the local timezone instead of UTC. This
604 makes <em>git log</em> (even without --date=local) show the same times
605 that <tt>svn log</tt> would in the local timezone.
606 </p>
607 <div class="paragraph"><p>This doesn&#8217;t interfere with interoperating with the Subversion
608 repository you cloned from, but if you wish for your local Git
609 repository to be able to interoperate with someone else&#8217;s local Git
610 repository, either don&#8217;t use this option or you should both use it in
611 the same local timezone.</p></div>
612 </dd>
613 <dt class="hdlist1">
614 --parent
615 </dt>
616 <dd>
618 Fetch only from the SVN parent of the current HEAD.
619 </p>
620 </dd>
621 <dt class="hdlist1">
622 --ignore-paths=&lt;regex&gt;
623 </dt>
624 <dd>
626 This allows one to specify a Perl regular expression that will
627 cause skipping of all matching paths from checkout from SVN.
628 The <em>--ignore-paths</em> option should match for every <em>fetch</em>
629 (including automatic fetches due to <em>clone</em>, <em>dcommit</em>,
630 <em>rebase</em>, etc) on a given repository.
631 </p>
632 <div class="verseblock">
633 <div class="verseblock-content">config key: svn-remote.&lt;name&gt;.ignore-paths</div>
634 <div class="verseblock-attribution">
635 </div></div>
636 <div class="paragraph"><p>If the ignore-paths config key is set and the command line option is
637 also given, both regular expressions will be used.</p></div>
638 <div class="paragraph"><p>Examples:</p></div>
639 <div class="dlist"><dl>
640 <dt class="hdlist1">
641 Skip "doc*" directory for every fetch
642 </dt>
643 <dd>
644 <div class="listingblock">
645 <div class="content">
646 <pre><tt>--ignore-paths="^doc"</tt></pre>
647 </div></div>
648 </dd>
649 <dt class="hdlist1">
650 Skip "branches" and "tags" of first level directories
651 </dt>
652 <dd>
653 <div class="listingblock">
654 <div class="content">
655 <pre><tt>--ignore-paths="^[^/]+/(?:branches|tags)"</tt></pre>
656 </div></div>
657 </dd>
658 </dl></div>
659 </dd>
660 </dl></div>
661 </dd>
662 <dt class="hdlist1">
663 <em>clone</em>
664 </dt>
665 <dd>
667 Runs <em>init</em> and <em>fetch</em>. It will automatically create a
668 directory based on the basename of the URL passed to it;
669 or if a second argument is passed; it will create a directory
670 and work within that. It accepts all arguments that the
671 <em>init</em> and <em>fetch</em> commands accept; with the exception of
672 <em>--fetch-all</em> and <em>--parent</em>. After a repository is cloned,
673 the <em>fetch</em> command will be able to update revisions without
674 affecting the working tree; and the <em>rebase</em> command will be
675 able to update the working tree with the latest changes.
676 </p>
677 </dd>
678 <dt class="hdlist1">
679 <em>rebase</em>
680 </dt>
681 <dd>
683 This fetches revisions from the SVN parent of the current HEAD
684 and rebases the current (uncommitted to SVN) work against it.
685 </p>
686 <div class="paragraph"><p>This works similarly to <tt>svn update</tt> or <em>git pull</em> except that
687 it preserves linear history with <em>git rebase</em> instead of
688 <em>git merge</em> for ease of dcommitting with <em>git svn</em>.</p></div>
689 <div class="paragraph"><p>This accepts all options that <em>git svn fetch</em> and <em>git rebase</em>
690 accept. However, <em>--fetch-all</em> only fetches from the current
691 [svn-remote], and not all [svn-remote] definitions.</p></div>
692 <div class="paragraph"><p>Like <em>git rebase</em>; this requires that the working tree be clean
693 and have no uncommitted changes.</p></div>
694 <div class="dlist"><dl>
695 <dt class="hdlist1">
697 </dt>
698 <dt class="hdlist1">
699 --local
700 </dt>
701 <dd>
703 Do not fetch remotely; only run <em>git rebase</em> against the
704 last fetched commit from the upstream SVN.
705 </p>
706 </dd>
707 </dl></div>
708 </dd>
709 <dt class="hdlist1">
710 <em>dcommit</em>
711 </dt>
712 <dd>
714 Commit each diff from a specified head directly to the SVN
715 repository, and then rebase or reset (depending on whether or
716 not there is a diff between SVN and head). This will create
717 a revision in SVN for each commit in git.
718 It is recommended that you run <em>git svn</em> fetch and rebase (not
719 pull or merge) your commits against the latest changes in the
720 SVN repository.
721 An optional revision or branch argument may be specified, and
722 causes <em>git svn</em> to do all work on that revision/branch
723 instead of HEAD.
724 This is advantageous over <em>set-tree</em> (below) because it produces
725 cleaner, more linear history.
726 </p>
727 <div class="dlist"><dl>
728 <dt class="hdlist1">
729 --no-rebase
730 </dt>
731 <dd>
733 After committing, do not rebase or reset.
734 </p>
735 </dd>
736 <dt class="hdlist1">
737 --commit-url &lt;URL&gt;
738 </dt>
739 <dd>
741 Commit to this SVN URL (the full path). This is intended to
742 allow existing <em>git svn</em> repositories created with one transport
743 method (e.g. <tt>svn://</tt> or <tt>http://</tt> for anonymous read) to be
744 reused if a user is later given access to an alternate transport
745 method (e.g. <tt>svn+ssh://</tt> or <tt>https://</tt>) for commit.
746 </p>
747 <div class="verseblock">
748 <div class="verseblock-content">config key: svn-remote.&lt;name&gt;.commiturl
749 config key: svn.commiturl (overwrites all svn-remote.&lt;name&gt;.commiturl options)</div>
750 <div class="verseblock-attribution">
751 </div></div>
752 <div class="paragraph"><p>Using this option for any other purpose (don&#8217;t ask) is very strongly
753 discouraged.</p></div>
754 </dd>
755 <dt class="hdlist1">
756 --mergeinfo=&lt;mergeinfo&gt;
757 </dt>
758 <dd>
760 Add the given merge information during the dcommit
761 (e.g. <tt>--mergeinfo="/branches/foo:1-10"</tt>). All svn server versions can
762 store this information (as a property), and svn clients starting from
763 version 1.5 can make use of it. <em>git svn</em> currently does not use it
764 and does not set it automatically.
765 </p>
766 </dd>
767 </dl></div>
768 </dd>
769 <dt class="hdlist1">
770 <em>branch</em>
771 </dt>
772 <dd>
774 Create a branch in the SVN repository.
775 </p>
776 <div class="dlist"><dl>
777 <dt class="hdlist1">
779 </dt>
780 <dt class="hdlist1">
781 --message
782 </dt>
783 <dd>
785 Allows to specify the commit message.
786 </p>
787 </dd>
788 <dt class="hdlist1">
790 </dt>
791 <dt class="hdlist1">
792 --tag
793 </dt>
794 <dd>
796 Create a tag by using the tags_subdir instead of the branches_subdir
797 specified during git svn init.
798 </p>
799 </dd>
800 <dt class="hdlist1">
802 </dt>
803 <dt class="hdlist1">
804 --destination
805 </dt>
806 <dd>
808 If more than one --branches (or --tags) option was given to the <em>init</em>
809 or <em>clone</em> command, you must provide the location of the branch (or
810 tag) you wish to create in the SVN repository. The value of this
811 option must match one of the paths specified by a --branches (or
812 --tags) option. You can see these paths with the commands
813 </p>
814 <div class="literalblock">
815 <div class="content">
816 <pre><tt>git config --get-all svn-remote.&lt;name&gt;.branches
817 git config --get-all svn-remote.&lt;name&gt;.tags</tt></pre>
818 </div></div>
819 <div class="paragraph"><p>where &lt;name&gt; is the name of the SVN repository as specified by the -R option to
820 <em>init</em> (or "svn" by default).</p></div>
821 </dd>
822 <dt class="hdlist1">
823 --username
824 </dt>
825 <dd>
827 Specify the SVN username to perform the commit as. This option overrides
828 the <em>username</em> configuration property.
829 </p>
830 </dd>
831 <dt class="hdlist1">
832 --commit-url
833 </dt>
834 <dd>
836 Use the specified URL to connect to the destination Subversion
837 repository. This is useful in cases where the source SVN
838 repository is read-only. This option overrides configuration
839 property <em>commiturl</em>.
840 </p>
841 <div class="literalblock">
842 <div class="content">
843 <pre><tt>git config --get-all svn-remote.&lt;name&gt;.commiturl</tt></pre>
844 </div></div>
845 </dd>
846 </dl></div>
847 </dd>
848 <dt class="hdlist1">
849 <em>tag</em>
850 </dt>
851 <dd>
853 Create a tag in the SVN repository. This is a shorthand for
854 <em>branch -t</em>.
855 </p>
856 </dd>
857 <dt class="hdlist1">
858 <em>log</em>
859 </dt>
860 <dd>
862 This should make it easy to look up svn log messages when svn
863 users refer to -r/--revision numbers.
864 </p>
865 <div class="paragraph"><p>The following features from &#8216;svn log&#8217; are supported:</p></div>
866 <div class="dlist"><dl>
867 <dt class="hdlist1">
868 -r &lt;n&gt;[:&lt;n&gt;]
869 </dt>
870 <dt class="hdlist1">
871 --revision=&lt;n&gt;[:&lt;n&gt;]
872 </dt>
873 <dd>
875 is supported, non-numeric args are not:
876 HEAD, NEXT, BASE, PREV, etc &#8230;
877 </p>
878 </dd>
879 <dt class="hdlist1">
881 </dt>
882 <dt class="hdlist1">
883 --verbose
884 </dt>
885 <dd>
887 it&#8217;s not completely compatible with the --verbose
888 output in svn log, but reasonably close.
889 </p>
890 </dd>
891 <dt class="hdlist1">
892 --limit=&lt;n&gt;
893 </dt>
894 <dd>
896 is NOT the same as --max-count, doesn&#8217;t count
897 merged/excluded commits
898 </p>
899 </dd>
900 <dt class="hdlist1">
901 --incremental
902 </dt>
903 <dd>
905 supported
906 </p>
907 </dd>
908 </dl></div>
909 <div class="paragraph"><p>New features:</p></div>
910 <div class="dlist"><dl>
911 <dt class="hdlist1">
912 --show-commit
913 </dt>
914 <dd>
916 shows the git commit sha1, as well
917 </p>
918 </dd>
919 <dt class="hdlist1">
920 --oneline
921 </dt>
922 <dd>
924 our version of --pretty=oneline
925 </p>
926 </dd>
927 </dl></div>
928 <div class="admonitionblock">
929 <table><tr>
930 <td class="icon">
931 <div class="title">Note</div>
932 </td>
933 <td class="content">SVN itself only stores times in UTC and nothing else. The regular svn
934 client converts the UTC time to the local time (or based on the TZ=
935 environment). This command has the same behaviour.</td>
936 </tr></table>
937 </div>
938 <div class="paragraph"><p>Any other arguments are passed directly to <em>git log</em></p></div>
939 </dd>
940 <dt class="hdlist1">
941 <em>blame</em>
942 </dt>
943 <dd>
945 Show what revision and author last modified each line of a file. The
946 output of this mode is format-compatible with the output of
947 &#8216;svn blame&#8217; by default. Like the SVN blame command,
948 local uncommitted changes in the working copy are ignored;
949 the version of the file in the HEAD revision is annotated. Unknown
950 arguments are passed directly to <em>git blame</em>.
951 </p>
952 <div class="dlist"><dl>
953 <dt class="hdlist1">
954 --git-format
955 </dt>
956 <dd>
958 Produce output in the same format as <em>git blame</em>, but with
959 SVN revision numbers instead of git commit hashes. In this mode,
960 changes that haven&#8217;t been committed to SVN (including local
961 working-copy edits) are shown as revision 0.
962 </p>
963 </dd>
964 </dl></div>
965 </dd>
966 <dt class="hdlist1">
967 <em>find-rev</em>
968 </dt>
969 <dd>
971 When given an SVN revision number of the form <em>rN</em>, returns the
972 corresponding git commit hash (this can optionally be followed by a
973 tree-ish to specify which branch should be searched). When given a
974 tree-ish, returns the corresponding SVN revision number.
975 </p>
976 </dd>
977 <dt class="hdlist1">
978 <em>set-tree</em>
979 </dt>
980 <dd>
982 You should consider using <em>dcommit</em> instead of this command.
983 Commit specified commit or tree objects to SVN. This relies on
984 your imported fetch data being up-to-date. This makes
985 absolutely no attempts to do patching when committing to SVN, it
986 simply overwrites files with those specified in the tree or
987 commit. All merging is assumed to have taken place
988 independently of <em>git svn</em> functions.
989 </p>
990 </dd>
991 <dt class="hdlist1">
992 <em>create-ignore</em>
993 </dt>
994 <dd>
996 Recursively finds the svn:ignore property on directories and
997 creates matching .gitignore files. The resulting files are staged to
998 be committed, but are not committed. Use -r/--revision to refer to a
999 specific revision.
1000 </p>
1001 </dd>
1002 <dt class="hdlist1">
1003 <em>show-ignore</em>
1004 </dt>
1005 <dd>
1007 Recursively finds and lists the svn:ignore property on
1008 directories. The output is suitable for appending to
1009 the $GIT_DIR/info/exclude file.
1010 </p>
1011 </dd>
1012 <dt class="hdlist1">
1013 <em>mkdirs</em>
1014 </dt>
1015 <dd>
1017 Attempts to recreate empty directories that core git cannot track
1018 based on information in $GIT_DIR/svn/&lt;refname&gt;/unhandled.log files.
1019 Empty directories are automatically recreated when using
1020 "git svn clone" and "git svn rebase", so "mkdirs" is intended
1021 for use after commands like "git checkout" or "git reset".
1022 (See the svn-remote.&lt;name&gt;.automkdirs config file option for
1023 more information.)
1024 </p>
1025 </dd>
1026 <dt class="hdlist1">
1027 <em>commit-diff</em>
1028 </dt>
1029 <dd>
1031 Commits the diff of two tree-ish arguments from the
1032 command-line. This command does not rely on being inside an <tt>git svn
1033 init</tt>-ed repository. This command takes three arguments, (a) the
1034 original tree to diff against, (b) the new tree result, (c) the
1035 URL of the target Subversion repository. The final argument
1036 (URL) may be omitted if you are working from a <em>git svn</em>-aware
1037 repository (that has been <tt>init</tt>-ed with <em>git svn</em>).
1038 The -r&lt;revision&gt; option is required for this.
1039 </p>
1040 </dd>
1041 <dt class="hdlist1">
1042 <em>info</em>
1043 </dt>
1044 <dd>
1046 Shows information about a file or directory similar to what
1047 &#8216;svn info&#8217; provides. Does not currently support a -r/--revision
1048 argument. Use the --url option to output only the value of the
1049 <em>URL:</em> field.
1050 </p>
1051 </dd>
1052 <dt class="hdlist1">
1053 <em>proplist</em>
1054 </dt>
1055 <dd>
1057 Lists the properties stored in the Subversion repository about a
1058 given file or directory. Use -r/--revision to refer to a specific
1059 Subversion revision.
1060 </p>
1061 </dd>
1062 <dt class="hdlist1">
1063 <em>propget</em>
1064 </dt>
1065 <dd>
1067 Gets the Subversion property given as the first argument, for a
1068 file. A specific revision can be specified with -r/--revision.
1069 </p>
1070 </dd>
1071 <dt class="hdlist1">
1072 <em>show-externals</em>
1073 </dt>
1074 <dd>
1076 Shows the Subversion externals. Use -r/--revision to specify a
1077 specific revision.
1078 </p>
1079 </dd>
1080 <dt class="hdlist1">
1081 <em>gc</em>
1082 </dt>
1083 <dd>
1085 Compress $GIT_DIR/svn/&lt;refname&gt;/unhandled.log files in .git/svn
1086 and remove $GIT_DIR/svn/&lt;refname&gt;index files in .git/svn.
1087 </p>
1088 </dd>
1089 <dt class="hdlist1">
1090 <em>reset</em>
1091 </dt>
1092 <dd>
1094 Undoes the effects of <em>fetch</em> back to the specified revision.
1095 This allows you to re-<em>fetch</em> an SVN revision. Normally the
1096 contents of an SVN revision should never change and <em>reset</em>
1097 should not be necessary. However, if SVN permissions change,
1098 or if you alter your --ignore-paths option, a <em>fetch</em> may fail
1099 with "not found in commit" (file not previously visible) or
1100 "checksum mismatch" (missed a modification). If the problem
1101 file cannot be ignored forever (with --ignore-paths) the only
1102 way to repair the repo is to use <em>reset</em>.
1103 </p>
1104 <div class="paragraph"><p>Only the rev_map and refs/remotes/git-svn are changed. Follow <em>reset</em>
1105 with a <em>fetch</em> and then <em>git reset</em> or <em>git rebase</em> to move local
1106 branches onto the new tree.</p></div>
1107 <div class="dlist"><dl>
1108 <dt class="hdlist1">
1109 -r &lt;n&gt;
1110 </dt>
1111 <dt class="hdlist1">
1112 --revision=&lt;n&gt;
1113 </dt>
1114 <dd>
1116 Specify the most recent revision to keep. All later revisions
1117 are discarded.
1118 </p>
1119 </dd>
1120 <dt class="hdlist1">
1122 </dt>
1123 <dt class="hdlist1">
1124 --parent
1125 </dt>
1126 <dd>
1128 Discard the specified revision as well, keeping the nearest
1129 parent instead.
1130 </p>
1131 </dd>
1132 <dt class="hdlist1">
1133 Example:
1134 </dt>
1135 <dd>
1137 Assume you have local changes in "master", but you need to refetch "r2".
1138 </p>
1139 <div class="listingblock">
1140 <div class="content">
1141 <pre><tt> r1---r2---r3 remotes/git-svn
1143 A---B master</tt></pre>
1144 </div></div>
1145 <div class="paragraph"><p>Fix the ignore-paths or SVN permissions problem that caused "r2" to
1146 be incomplete in the first place. Then:</p></div>
1147 <div class="verseblock">
1148 <div class="verseblock-content">git svn reset -r2 -p
1149 git svn fetch</div>
1150 <div class="verseblock-attribution">
1151 </div></div>
1152 <div class="listingblock">
1153 <div class="content">
1154 <pre><tt> r1---r2'--r3' remotes/git-svn
1156 r2---r3---A---B master</tt></pre>
1157 </div></div>
1158 <div class="paragraph"><p>Then fixup "master" with <em>git rebase</em>.
1159 Do NOT use <em>git merge</em> or your history will not be compatible with a
1160 future <em>dcommit</em>!</p></div>
1161 <div class="verseblock">
1162 <div class="verseblock-content">git rebase --onto remotes/git-svn A^ master</div>
1163 <div class="verseblock-attribution">
1164 </div></div>
1165 <div class="listingblock">
1166 <div class="content">
1167 <pre><tt> r1---r2'--r3' remotes/git-svn
1169 A'--B' master</tt></pre>
1170 </div></div>
1171 </dd>
1172 </dl></div>
1173 </dd>
1174 </dl></div>
1175 </div>
1176 <h2 id="_options">OPTIONS</h2>
1177 <div class="sectionbody">
1178 <div class="dlist"><dl>
1179 <dt class="hdlist1">
1180 --shared[=(false|true|umask|group|all|world|everybody)]
1181 </dt>
1182 <dt class="hdlist1">
1183 --template=&lt;template_directory&gt;
1184 </dt>
1185 <dd>
1187 Only used with the <em>init</em> command.
1188 These are passed directly to <em>git init</em>.
1189 </p>
1190 </dd>
1191 <dt class="hdlist1">
1192 -r &lt;arg&gt;
1193 </dt>
1194 <dt class="hdlist1">
1195 --revision &lt;arg&gt;
1196 </dt>
1197 <dd>
1199 Used with the <em>fetch</em> command.
1200 </p>
1201 <div class="paragraph"><p>This allows revision ranges for partial/cauterized history
1202 to be supported. $NUMBER, $NUMBER1:$NUMBER2 (numeric ranges),
1203 $NUMBER:HEAD, and BASE:$NUMBER are all supported.</p></div>
1204 <div class="paragraph"><p>This can allow you to make partial mirrors when running fetch;
1205 but is generally not recommended because history will be skipped
1206 and lost.</p></div>
1207 </dd>
1208 <dt class="hdlist1">
1210 </dt>
1211 <dt class="hdlist1">
1212 --stdin
1213 </dt>
1214 <dd>
1216 Only used with the <em>set-tree</em> command.
1217 </p>
1218 <div class="paragraph"><p>Read a list of commits from stdin and commit them in reverse
1219 order. Only the leading sha1 is read from each line, so
1220 <em>git rev-list --pretty=oneline</em> output can be used.</p></div>
1221 </dd>
1222 <dt class="hdlist1">
1223 --rmdir
1224 </dt>
1225 <dd>
1227 Only used with the <em>dcommit</em>, <em>set-tree</em> and <em>commit-diff</em> commands.
1228 </p>
1229 <div class="paragraph"><p>Remove directories from the SVN tree if there are no files left
1230 behind. SVN can version empty directories, and they are not
1231 removed by default if there are no files left in them. git
1232 cannot version empty directories. Enabling this flag will make
1233 the commit to SVN act like git.</p></div>
1234 <div class="verseblock">
1235 <div class="verseblock-content">config key: svn.rmdir</div>
1236 <div class="verseblock-attribution">
1237 </div></div>
1238 </dd>
1239 <dt class="hdlist1">
1241 </dt>
1242 <dt class="hdlist1">
1243 --edit
1244 </dt>
1245 <dd>
1247 Only used with the <em>dcommit</em>, <em>set-tree</em> and <em>commit-diff</em> commands.
1248 </p>
1249 <div class="paragraph"><p>Edit the commit message before committing to SVN. This is off by
1250 default for objects that are commits, and forced on when committing
1251 tree objects.</p></div>
1252 <div class="verseblock">
1253 <div class="verseblock-content">config key: svn.edit</div>
1254 <div class="verseblock-attribution">
1255 </div></div>
1256 </dd>
1257 <dt class="hdlist1">
1258 -l&lt;num&gt;
1259 </dt>
1260 <dt class="hdlist1">
1261 --find-copies-harder
1262 </dt>
1263 <dd>
1265 Only used with the <em>dcommit</em>, <em>set-tree</em> and <em>commit-diff</em> commands.
1266 </p>
1267 <div class="paragraph"><p>They are both passed directly to <em>git diff-tree</em>; see
1268 <a href="git-diff-tree.html">git-diff-tree(1)</a> for more information.</p></div>
1269 <div class="verseblock">
1270 <div class="verseblock-content">config key: svn.l
1271 config key: svn.findcopiesharder</div>
1272 <div class="verseblock-attribution">
1273 </div></div>
1274 </dd>
1275 <dt class="hdlist1">
1276 -A&lt;filename&gt;
1277 </dt>
1278 <dt class="hdlist1">
1279 --authors-file=&lt;filename&gt;
1280 </dt>
1281 <dd>
1283 Syntax is compatible with the file used by <em>git cvsimport</em>:
1284 </p>
1285 <div class="listingblock">
1286 <div class="content">
1287 <pre><tt> loginname = Joe User &lt;user@example.com&gt;</tt></pre>
1288 </div></div>
1289 <div class="paragraph"><p>If this option is specified and <em>git svn</em> encounters an SVN
1290 committer name that does not exist in the authors-file, <em>git svn</em>
1291 will abort operation. The user will then have to add the
1292 appropriate entry. Re-running the previous <em>git svn</em> command
1293 after the authors-file is modified should continue operation.</p></div>
1294 <div class="verseblock">
1295 <div class="verseblock-content">config key: svn.authorsfile</div>
1296 <div class="verseblock-attribution">
1297 </div></div>
1298 </dd>
1299 <dt class="hdlist1">
1300 --authors-prog=&lt;filename&gt;
1301 </dt>
1302 <dd>
1304 If this option is specified, for each SVN committer name that
1305 does not exist in the authors file, the given file is executed
1306 with the committer name as the first argument. The program is
1307 expected to return a single line of the form "Name &lt;email&gt;",
1308 which will be treated as if included in the authors file.
1309 </p>
1310 </dd>
1311 <dt class="hdlist1">
1313 </dt>
1314 <dt class="hdlist1">
1315 --quiet
1316 </dt>
1317 <dd>
1319 Make <em>git svn</em> less verbose. Specify a second time to make it
1320 even less verbose.
1321 </p>
1322 </dd>
1323 <dt class="hdlist1">
1324 --repack[=&lt;n&gt;]
1325 </dt>
1326 <dt class="hdlist1">
1327 --repack-flags=&lt;flags&gt;
1328 </dt>
1329 <dd>
1331 These should help keep disk usage sane for large fetches with
1332 many revisions.
1333 </p>
1334 <div class="paragraph"><p>--repack takes an optional argument for the number of revisions
1335 to fetch before repacking. This defaults to repacking every
1336 1000 commits fetched if no argument is specified.</p></div>
1337 <div class="paragraph"><p>--repack-flags are passed directly to <em>git repack</em>.</p></div>
1338 <div class="verseblock">
1339 <div class="verseblock-content">config key: svn.repack
1340 config key: svn.repackflags</div>
1341 <div class="verseblock-attribution">
1342 </div></div>
1343 </dd>
1344 <dt class="hdlist1">
1346 </dt>
1347 <dt class="hdlist1">
1348 --merge
1349 </dt>
1350 <dt class="hdlist1">
1351 -s&lt;strategy&gt;
1352 </dt>
1353 <dt class="hdlist1">
1354 --strategy=&lt;strategy&gt;
1355 </dt>
1356 <dd>
1358 These are only used with the <em>dcommit</em> and <em>rebase</em> commands.
1359 </p>
1360 <div class="paragraph"><p>Passed directly to <em>git rebase</em> when using <em>dcommit</em> if a
1361 <em>git reset</em> cannot be used (see <em>dcommit</em>).</p></div>
1362 </dd>
1363 <dt class="hdlist1">
1365 </dt>
1366 <dt class="hdlist1">
1367 --dry-run
1368 </dt>
1369 <dd>
1371 This can be used with the <em>dcommit</em>, <em>rebase</em>, <em>branch</em> and
1372 <em>tag</em> commands.
1373 </p>
1374 <div class="paragraph"><p>For <em>dcommit</em>, print out the series of git arguments that would show
1375 which diffs would be committed to SVN.</p></div>
1376 <div class="paragraph"><p>For <em>rebase</em>, display the local branch associated with the upstream svn
1377 repository associated with the current branch and the URL of svn
1378 repository that will be fetched from.</p></div>
1379 <div class="paragraph"><p>For <em>branch</em> and <em>tag</em>, display the urls that will be used for copying when
1380 creating the branch or tag.</p></div>
1381 </dd>
1382 <dt class="hdlist1">
1383 --use-log-author
1384 </dt>
1385 <dd>
1387 When retrieving svn commits into git (as part of <em>fetch</em>, <em>rebase</em>, or
1388 <em>dcommit</em> operations), look for the first <tt>From:</tt> or <tt>Signed-off-by:</tt> line
1389 in the log message and use that as the author string.
1390 </p>
1391 </dd>
1392 <dt class="hdlist1">
1393 --add-author-from
1394 </dt>
1395 <dd>
1397 When committing to svn from git (as part of <em>commit-diff</em>, <em>set-tree</em> or <em>dcommit</em>
1398 operations), if the existing log message doesn&#8217;t already have a
1399 <tt>From:</tt> or <tt>Signed-off-by:</tt> line, append a <tt>From:</tt> line based on the
1400 git commit&#8217;s author string. If you use this, then <tt>--use-log-author</tt>
1401 will retrieve a valid author string for all commits.
1402 </p>
1403 </dd>
1404 </dl></div>
1405 </div>
1406 <h2 id="_advanced_options">ADVANCED OPTIONS</h2>
1407 <div class="sectionbody">
1408 <div class="dlist"><dl>
1409 <dt class="hdlist1">
1410 -i&lt;GIT_SVN_ID&gt;
1411 </dt>
1412 <dt class="hdlist1">
1413 --id &lt;GIT_SVN_ID&gt;
1414 </dt>
1415 <dd>
1417 This sets GIT_SVN_ID (instead of using the environment). This
1418 allows the user to override the default refname to fetch from
1419 when tracking a single URL. The <em>log</em> and <em>dcommit</em> commands
1420 no longer require this switch as an argument.
1421 </p>
1422 </dd>
1423 <dt class="hdlist1">
1424 -R&lt;remote name&gt;
1425 </dt>
1426 <dt class="hdlist1">
1427 --svn-remote &lt;remote name&gt;
1428 </dt>
1429 <dd>
1431 Specify the [svn-remote "&lt;remote name&gt;"] section to use,
1432 this allows SVN multiple repositories to be tracked.
1433 Default: "svn"
1434 </p>
1435 </dd>
1436 <dt class="hdlist1">
1437 --follow-parent
1438 </dt>
1439 <dd>
1441 This is especially helpful when we&#8217;re tracking a directory
1442 that has been moved around within the repository, or if we
1443 started tracking a branch and never tracked the trunk it was
1444 descended from. This feature is enabled by default, use
1445 --no-follow-parent to disable it.
1446 </p>
1447 <div class="verseblock">
1448 <div class="verseblock-content">config key: svn.followparent</div>
1449 <div class="verseblock-attribution">
1450 </div></div>
1451 </dd>
1452 </dl></div>
1453 </div>
1454 <h2 id="_config_file_only_options">CONFIG FILE-ONLY OPTIONS</h2>
1455 <div class="sectionbody">
1456 <div class="dlist"><dl>
1457 <dt class="hdlist1">
1458 svn.noMetadata
1459 </dt>
1460 <dt class="hdlist1">
1461 svn-remote.&lt;name&gt;.noMetadata
1462 </dt>
1463 <dd>
1465 This gets rid of the <em>git-svn-id:</em> lines at the end of every commit.
1466 </p>
1467 <div class="paragraph"><p>This option can only be used for one-shot imports as <em>git svn</em>
1468 will not be able to fetch again without metadata. Additionally,
1469 if you lose your .git/svn/<strong>*/.rev_map.</strong> files, <em>git svn</em> will not
1470 be able to rebuild them.</p></div>
1471 <div class="paragraph"><p>The <em>git svn log</em> command will not work on repositories using
1472 this, either. Using this conflicts with the <em>useSvmProps</em>
1473 option for (hopefully) obvious reasons.</p></div>
1474 <div class="paragraph"><p>This option is NOT recommended as it makes it difficult to track down
1475 old references to SVN revision numbers in existing documentation, bug
1476 reports and archives. If you plan to eventually migrate from SVN to git
1477 and are certain about dropping SVN history, consider
1478 <a href="git-filter-branch.html">git-filter-branch(1)</a> instead. filter-branch also allows
1479 reformatting of metadata for ease-of-reading and rewriting authorship
1480 info for non-"svn.authorsFile" users.</p></div>
1481 </dd>
1482 <dt class="hdlist1">
1483 svn.useSvmProps
1484 </dt>
1485 <dt class="hdlist1">
1486 svn-remote.&lt;name&gt;.useSvmProps
1487 </dt>
1488 <dd>
1490 This allows <em>git svn</em> to re-map repository URLs and UUIDs from
1491 mirrors created using SVN::Mirror (or svk) for metadata.
1492 </p>
1493 <div class="paragraph"><p>If an SVN revision has a property, "svm:headrev", it is likely
1494 that the revision was created by SVN::Mirror (also used by SVK).
1495 The property contains a repository UUID and a revision. We want
1496 to make it look like we are mirroring the original URL, so
1497 introduce a helper function that returns the original identity
1498 URL and UUID, and use it when generating metadata in commit
1499 messages.</p></div>
1500 </dd>
1501 <dt class="hdlist1">
1502 svn.useSvnsyncProps
1503 </dt>
1504 <dt class="hdlist1">
1505 svn-remote.&lt;name&gt;.useSvnsyncprops
1506 </dt>
1507 <dd>
1509 Similar to the useSvmProps option; this is for users
1510 of the svnsync(1) command distributed with SVN 1.4.x and
1511 later.
1512 </p>
1513 </dd>
1514 <dt class="hdlist1">
1515 svn-remote.&lt;name&gt;.rewriteRoot
1516 </dt>
1517 <dd>
1519 This allows users to create repositories from alternate
1520 URLs. For example, an administrator could run <em>git svn</em> on the
1521 server locally (accessing via file://) but wish to distribute
1522 the repository with a public http:// or svn:// URL in the
1523 metadata so users of it will see the public URL.
1524 </p>
1525 </dd>
1526 <dt class="hdlist1">
1527 svn-remote.&lt;name&gt;.rewriteUUID
1528 </dt>
1529 <dd>
1531 Similar to the useSvmProps option; this is for users who need
1532 to remap the UUID manually. This may be useful in situations
1533 where the original UUID is not available via either useSvmProps
1534 or useSvnsyncProps.
1535 </p>
1536 </dd>
1537 <dt class="hdlist1">
1538 svn-remote.&lt;name&gt;.pushurl
1539 </dt>
1540 <dd>
1542 Similar to git&#8217;s <em>remote.&lt;name&gt;.pushurl</em>, this key is designed
1543 to be used in cases where <em>url</em> points to an SVN repository
1544 via a read-only transport, to provide an alternate read/write
1545 transport. It is assumed that both keys point to the same
1546 repository. Unlike <em>commiturl</em>, <em>pushurl</em> is a base path. If
1547 either <em>commiturl</em> or <em>pushurl</em> could be used, <em>commiturl</em>
1548 takes precedence.
1549 </p>
1550 </dd>
1551 <dt class="hdlist1">
1552 svn.brokenSymlinkWorkaround
1553 </dt>
1554 <dd>
1556 This disables potentially expensive checks to workaround
1557 broken symlinks checked into SVN by broken clients. Set this
1558 option to "false" if you track a SVN repository with many
1559 empty blobs that are not symlinks. This option may be changed
1560 while <em>git svn</em> is running and take effect on the next
1561 revision fetched. If unset, <em>git svn</em> assumes this option to
1562 be "true".
1563 </p>
1564 </dd>
1565 <dt class="hdlist1">
1566 svn.pathnameencoding
1567 </dt>
1568 <dd>
1570 This instructs git svn to recode pathnames to a given encoding.
1571 It can be used by windows users and by those who work in non-utf8
1572 locales to avoid corrupted file names with non-ASCII characters.
1573 Valid encodings are the ones supported by Perl&#8217;s Encode module.
1574 </p>
1575 </dd>
1576 <dt class="hdlist1">
1577 svn-remote.&lt;name&gt;.automkdirs
1578 </dt>
1579 <dd>
1581 Normally, the "git svn clone" and "git svn rebase" commands
1582 attempt to recreate empty directories that are in the
1583 Subversion repository. If this option is set to "false", then
1584 empty directories will only be created if the "git svn mkdirs"
1585 command is run explicitly. If unset, <em>git svn</em> assumes this
1586 option to be "true".
1587 </p>
1588 </dd>
1589 </dl></div>
1590 <div class="paragraph"><p>Since the noMetadata, rewriteRoot, rewriteUUID, useSvnsyncProps and useSvmProps
1591 options all affect the metadata generated and used by <em>git svn</em>; they
1592 <strong>must</strong> be set in the configuration file before any history is imported
1593 and these settings should never be changed once they are set.</p></div>
1594 <div class="paragraph"><p>Additionally, only one of these options can be used per svn-remote
1595 section because they affect the <em>git-svn-id:</em> metadata line, except
1596 for rewriteRoot and rewriteUUID which can be used together.</p></div>
1597 </div>
1598 <h2 id="_basic_examples">BASIC EXAMPLES</h2>
1599 <div class="sectionbody">
1600 <div class="paragraph"><p>Tracking and contributing to the trunk of a Subversion-managed project:</p></div>
1601 <div class="listingblock">
1602 <div class="content">
1603 <pre><tt># Clone a repo (like git clone):
1604 git svn clone http://svn.example.com/project/trunk
1605 # Enter the newly cloned directory:
1606 cd trunk
1607 # You should be on master branch, double-check with 'git branch'
1608 git branch
1609 # Do some work and commit locally to git:
1610 git commit ...
1611 # Something is committed to SVN, rebase your local changes against the
1612 # latest changes in SVN:
1613 git svn rebase
1614 # Now commit your changes (that were committed previously using git) to SVN,
1615 # as well as automatically updating your working HEAD:
1616 git svn dcommit
1617 # Append svn:ignore settings to the default git exclude file:
1618 git svn show-ignore &gt;&gt; .git/info/exclude</tt></pre>
1619 </div></div>
1620 <div class="paragraph"><p>Tracking and contributing to an entire Subversion-managed project
1621 (complete with a trunk, tags and branches):</p></div>
1622 <div class="listingblock">
1623 <div class="content">
1624 <pre><tt># Clone a repo (like git clone):
1625 git svn clone http://svn.example.com/project -T trunk -b branches -t tags
1626 # View all branches and tags you have cloned:
1627 git branch -r
1628 # Create a new branch in SVN
1629 git svn branch waldo
1630 # Reset your master to trunk (or any other branch, replacing 'trunk'
1631 # with the appropriate name):
1632 git reset --hard remotes/trunk
1633 # You may only dcommit to one branch/tag/trunk at a time. The usage
1634 # of dcommit/rebase/show-ignore should be the same as above.</tt></pre>
1635 </div></div>
1636 <div class="paragraph"><p>The initial <em>git svn clone</em> can be quite time-consuming
1637 (especially for large Subversion repositories). If multiple
1638 people (or one person with multiple machines) want to use
1639 <em>git svn</em> to interact with the same Subversion repository, you can
1640 do the initial <em>git svn clone</em> to a repository on a server and
1641 have each person clone that repository with <em>git clone</em>:</p></div>
1642 <div class="listingblock">
1643 <div class="content">
1644 <pre><tt># Do the initial import on a server
1645 ssh server "cd /pub &amp;&amp; git svn clone http://svn.example.com/project
1646 # Clone locally - make sure the refs/remotes/ space matches the server
1647 mkdir project
1648 cd project
1649 git init
1650 git remote add origin server:/pub/project
1651 git config --replace-all remote.origin.fetch '+refs/remotes/*:refs/remotes/*'
1652 git fetch
1653 # Prevent fetch/pull from remote git server in the future,
1654 # we only want to use git svn for future updates
1655 git config --remove-section remote.origin
1656 # Create a local branch from one of the branches just fetched
1657 git checkout -b master FETCH_HEAD
1658 # Initialize 'git svn' locally (be sure to use the same URL and -T/-b/-t options as were used on server)
1659 git svn init http://svn.example.com/project
1660 # Pull the latest changes from Subversion
1661 git svn rebase</tt></pre>
1662 </div></div>
1663 </div>
1664 <h2 id="_rebase_vs_pull_merge">REBASE VS. PULL/MERGE</h2>
1665 <div class="sectionbody">
1666 <div class="paragraph"><p>Originally, <em>git svn</em> recommended that the <em>remotes/git-svn</em> branch be
1667 pulled or merged from. This is because the author favored
1668 <tt>git svn set-tree B</tt> to commit a single head rather than the
1669 <tt>git svn set-tree A..B</tt> notation to commit multiple commits.</p></div>
1670 <div class="paragraph"><p>If you use <tt>git svn set-tree A..B</tt> to commit several diffs and you do
1671 not have the latest remotes/git-svn merged into my-branch, you should
1672 use <tt>git svn rebase</tt> to update your work branch instead of <tt>git pull</tt> or
1673 <tt>git merge</tt>. <tt>pull</tt>/<tt>merge</tt> can cause non-linear history to be flattened
1674 when committing into SVN, which can lead to merge commits reversing
1675 previous commits in SVN.</p></div>
1676 </div>
1677 <h2 id="_merge_tracking">MERGE TRACKING</h2>
1678 <div class="sectionbody">
1679 <div class="paragraph"><p>While <em>git svn</em> can track
1680 copy history (including branches and tags) for repositories adopting a
1681 standard layout, it cannot yet represent merge history that happened
1682 inside git back upstream to SVN users. Therefore it is advised that
1683 users keep history as linear as possible inside git to ease
1684 compatibility with SVN (see the CAVEATS section below).</p></div>
1685 </div>
1686 <h2 id="_caveats">CAVEATS</h2>
1687 <div class="sectionbody">
1688 <div class="paragraph"><p>For the sake of simplicity and interoperating with Subversion,
1689 it is recommended that all <em>git svn</em> users clone, fetch and dcommit
1690 directly from the SVN server, and avoid all <em>git clone</em>/<em>pull</em>/<em>merge</em>/<em>push</em>
1691 operations between git repositories and branches. The recommended
1692 method of exchanging code between git branches and users is
1693 <em>git format-patch</em> and <em>git am</em>, or just 'dcommit&#8217;ing to the SVN repository.</p></div>
1694 <div class="paragraph"><p>Running <em>git merge</em> or <em>git pull</em> is NOT recommended on a branch you
1695 plan to <em>dcommit</em> from because Subversion users cannot see any
1696 merges you&#8217;ve made. Furthermore, if you merge or pull from a git branch
1697 that is a mirror of an SVN branch, <em>dcommit</em> may commit to the wrong
1698 branch.</p></div>
1699 <div class="paragraph"><p>If you do merge, note the following rule: <em>git svn dcommit</em> will
1700 attempt to commit on top of the SVN commit named in</p></div>
1701 <div class="listingblock">
1702 <div class="content">
1703 <pre><tt>git log --grep=^git-svn-id: --first-parent -1</tt></pre>
1704 </div></div>
1705 <div class="paragraph"><p>You <em>must</em> therefore ensure that the most recent commit of the branch
1706 you want to dcommit to is the <em>first</em> parent of the merge. Chaos will
1707 ensue otherwise, especially if the first parent is an older commit on
1708 the same SVN branch.</p></div>
1709 <div class="paragraph"><p><em>git clone</em> does not clone branches under the refs/remotes/ hierarchy or
1710 any <em>git svn</em> metadata, or config. So repositories created and managed with
1711 using <em>git svn</em> should use <em>rsync</em> for cloning, if cloning is to be done
1712 at all.</p></div>
1713 <div class="paragraph"><p>Since <em>dcommit</em> uses rebase internally, any git branches you <em>git push</em> to
1714 before <em>dcommit</em> on will require forcing an overwrite of the existing ref
1715 on the remote repository. This is generally considered bad practice,
1716 see the <a href="git-push.html">git-push(1)</a> documentation for details.</p></div>
1717 <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
1718 already dcommitted. It is considered bad practice to --amend commits
1719 you&#8217;ve already pushed to a remote repository for other users, and
1720 dcommit with SVN is analogous to that.</p></div>
1721 <div class="paragraph"><p>When using multiple --branches or --tags, <em>git svn</em> does not automatically
1722 handle name collisions (for example, if two branches from different paths have
1723 the same name, or if a branch and a tag have the same name). In these cases,
1724 use <em>init</em> to set up your git repository then, before your first <em>fetch</em>, edit
1725 the .git/config file so that the branches and tags are associated with
1726 different name spaces. For example:</p></div>
1727 <div class="literalblock">
1728 <div class="content">
1729 <pre><tt>branches = stable/*:refs/remotes/svn/stable/*
1730 branches = debug/*:refs/remotes/svn/debug/*</tt></pre>
1731 </div></div>
1732 </div>
1733 <h2 id="_bugs">BUGS</h2>
1734 <div class="sectionbody">
1735 <div class="paragraph"><p>We ignore all SVN properties except svn:executable. Any unhandled
1736 properties are logged to $GIT_DIR/svn/&lt;refname&gt;/unhandled.log</p></div>
1737 <div class="paragraph"><p>Renamed and copied directories are not detected by git and hence not
1738 tracked when committing to SVN. I do not plan on adding support for
1739 this as it&#8217;s quite difficult and time-consuming to get working for all
1740 the possible corner cases (git doesn&#8217;t do it, either). Committing
1741 renamed and copied files is fully supported if they&#8217;re similar enough
1742 for git to detect them.</p></div>
1743 </div>
1744 <h2 id="_configuration">CONFIGURATION</h2>
1745 <div class="sectionbody">
1746 <div class="paragraph"><p><em>git svn</em> stores [svn-remote] configuration information in the
1747 repository .git/config file. It is similar the core git
1748 [remote] sections except <em>fetch</em> keys do not accept glob
1749 arguments; but they are instead handled by the <em>branches</em>
1750 and <em>tags</em> keys. Since some SVN repositories are oddly
1751 configured with multiple projects glob expansions such those
1752 listed below are allowed:</p></div>
1753 <div class="listingblock">
1754 <div class="content">
1755 <pre><tt>[svn-remote "project-a"]
1756 url = http://server.org/svn
1757 fetch = trunk/project-a:refs/remotes/project-a/trunk
1758 branches = branches/*/project-a:refs/remotes/project-a/branches/*
1759 tags = tags/*/project-a:refs/remotes/project-a/tags/*</tt></pre>
1760 </div></div>
1761 <div class="paragraph"><p>Keep in mind that the <em>*</em> (asterisk) wildcard of the local ref
1762 (right of the <em>:</em>) <strong>must</strong> be the farthest right path component;
1763 however the remote wildcard may be anywhere as long as it&#8217;s an
1764 independent path component (surrounded by <em>/</em> or EOL). This
1765 type of configuration is not automatically created by <em>init</em> and
1766 should be manually entered with a text-editor or using <em>git config</em>.</p></div>
1767 <div class="paragraph"><p>It is also possible to fetch a subset of branches or tags by using a
1768 comma-separated list of names within braces. For example:</p></div>
1769 <div class="listingblock">
1770 <div class="content">
1771 <pre><tt>[svn-remote "huge-project"]
1772 url = http://server.org/svn
1773 fetch = trunk/src:refs/remotes/trunk
1774 branches = branches/{red,green}/src:refs/remotes/branches/*
1775 tags = tags/{1.0,2.0}/src:refs/remotes/tags/*</tt></pre>
1776 </div></div>
1777 <div class="paragraph"><p>Note that git-svn keeps track of the highest revision in which a branch
1778 or tag has appeared. If the subset of branches or tags is changed after
1779 fetching, then .git/svn/.metadata must be manually edited to remove (or
1780 reset) branches-maxRev and/or tags-maxRev as appropriate.</p></div>
1781 </div>
1782 <h2 id="_see_also">SEE ALSO</h2>
1783 <div class="sectionbody">
1784 <div class="paragraph"><p><a href="git-rebase.html">git-rebase(1)</a></p></div>
1785 </div>
1786 <h2 id="_git">GIT</h2>
1787 <div class="sectionbody">
1788 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
1789 </div>
1790 <div id="footer">
1791 <div id="footer-text">
1792 Last updated 2011-07-23 00:49:30 UTC
1793 </div>
1794 </div>
1795 </body>
1796 </html>