Autogenerated HTML docs for v1.7.7-419-g87009
[git/jnareb-git.git] / git-svn.html
blob0c40633e61e5e25cd01901e4f465bdb55234b460
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.5.2" />
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.0em;
122 margin-bottom: 1.5em;
124 div.admonitionblock {
125 margin-top: 2.0em;
126 margin-bottom: 2.0em;
127 margin-right: 10%;
128 color: #606060;
131 div.content { /* Block element content. */
132 padding: 0;
135 /* Block element titles. */
136 div.title, caption.title {
137 color: #527bbd;
138 font-family: sans-serif;
139 font-weight: bold;
140 text-align: left;
141 margin-top: 1.0em;
142 margin-bottom: 0.5em;
144 div.title + * {
145 margin-top: 0;
148 td div.title:first-child {
149 margin-top: 0.0em;
151 div.content div.title:first-child {
152 margin-top: 0.0em;
154 div.content + div.title {
155 margin-top: 0.0em;
158 div.sidebarblock > div.content {
159 background: #ffffee;
160 border: 1px solid silver;
161 padding: 0.5em;
164 div.listingblock > div.content {
165 border: 1px solid silver;
166 background: #f4f4f4;
167 padding: 0.5em;
170 div.quoteblock, div.verseblock {
171 padding-left: 1.0em;
172 margin-left: 1.0em;
173 margin-right: 10%;
174 border-left: 5px solid #dddddd;
175 color: #777777;
178 div.quoteblock > div.attribution {
179 padding-top: 0.5em;
180 text-align: right;
183 div.verseblock > div.content {
184 white-space: pre;
186 div.verseblock > div.attribution {
187 padding-top: 0.75em;
188 text-align: left;
190 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
191 div.verseblock + div.attribution {
192 text-align: left;
195 div.admonitionblock .icon {
196 vertical-align: top;
197 font-size: 1.1em;
198 font-weight: bold;
199 text-decoration: underline;
200 color: #527bbd;
201 padding-right: 0.5em;
203 div.admonitionblock td.content {
204 padding-left: 0.5em;
205 border-left: 3px solid #dddddd;
208 div.exampleblock > div.content {
209 border-left: 3px solid #dddddd;
210 padding-left: 0.5em;
213 div.imageblock div.content { padding-left: 0; }
214 span.image img { border-style: none; }
215 a.image:visited { color: white; }
217 dl {
218 margin-top: 0.8em;
219 margin-bottom: 0.8em;
221 dt {
222 margin-top: 0.5em;
223 margin-bottom: 0;
224 font-style: normal;
225 color: navy;
227 dd > *:first-child {
228 margin-top: 0.1em;
231 ul, ol {
232 list-style-position: outside;
234 ol.arabic {
235 list-style-type: decimal;
237 ol.loweralpha {
238 list-style-type: lower-alpha;
240 ol.upperalpha {
241 list-style-type: upper-alpha;
243 ol.lowerroman {
244 list-style-type: lower-roman;
246 ol.upperroman {
247 list-style-type: upper-roman;
250 div.compact ul, div.compact ol,
251 div.compact p, div.compact p,
252 div.compact div, div.compact div {
253 margin-top: 0.1em;
254 margin-bottom: 0.1em;
257 div.tableblock > table {
258 border: 3px solid #527bbd;
260 thead, p.table.header {
261 font-family: sans-serif;
262 font-weight: bold;
264 tfoot {
265 font-weight: bold;
267 td > div.verse {
268 white-space: pre;
270 p.table {
271 margin-top: 0;
273 /* Because the table frame attribute is overriden by CSS in most browsers. */
274 div.tableblock > table[frame="void"] {
275 border-style: none;
277 div.tableblock > table[frame="hsides"] {
278 border-left-style: none;
279 border-right-style: none;
281 div.tableblock > table[frame="vsides"] {
282 border-top-style: none;
283 border-bottom-style: none;
287 div.hdlist {
288 margin-top: 0.8em;
289 margin-bottom: 0.8em;
291 div.hdlist tr {
292 padding-bottom: 15px;
294 dt.hdlist1.strong, td.hdlist1.strong {
295 font-weight: bold;
297 td.hdlist1 {
298 vertical-align: top;
299 font-style: normal;
300 padding-right: 0.8em;
301 color: navy;
303 td.hdlist2 {
304 vertical-align: top;
306 div.hdlist.compact tr {
307 margin: 0;
308 padding-bottom: 0;
311 .comment {
312 background: yellow;
315 .footnote, .footnoteref {
316 font-size: 0.8em;
319 span.footnote, span.footnoteref {
320 vertical-align: super;
323 #footnotes {
324 margin: 20px 0 20px 0;
325 padding: 7px 0 0 0;
328 #footnotes div.footnote {
329 margin: 0 0 5px 0;
332 #footnotes hr {
333 border: none;
334 border-top: 1px solid silver;
335 height: 1px;
336 text-align: left;
337 margin-left: 0;
338 width: 20%;
339 min-width: 100px;
343 @media print {
344 div#footer-badges { display: none; }
347 div#toc {
348 margin-bottom: 2.5em;
351 div#toctitle {
352 color: #527bbd;
353 font-family: sans-serif;
354 font-size: 1.1em;
355 font-weight: bold;
356 margin-top: 1.0em;
357 margin-bottom: 0.1em;
360 div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
361 margin-top: 0;
362 margin-bottom: 0;
364 div.toclevel2 {
365 margin-left: 2em;
366 font-size: 0.9em;
368 div.toclevel3 {
369 margin-left: 4em;
370 font-size: 0.9em;
372 div.toclevel4 {
373 margin-left: 6em;
374 font-size: 0.9em;
376 /* Overrides for manpage documents */
377 h1 {
378 padding-top: 0.5em;
379 padding-bottom: 0.5em;
380 border-top: 2px solid silver;
381 border-bottom: 2px solid silver;
383 h2 {
384 border-style: none;
386 div.sectionbody {
387 margin-left: 5%;
390 @media print {
391 div#toc { display: none; }
394 /* Workarounds for IE6's broken and incomplete CSS2. */
396 div.sidebar-content {
397 background: #ffffee;
398 border: 1px solid silver;
399 padding: 0.5em;
401 div.sidebar-title, div.image-title {
402 color: #527bbd;
403 font-family: sans-serif;
404 font-weight: bold;
405 margin-top: 0.0em;
406 margin-bottom: 0.5em;
409 div.listingblock div.content {
410 border: 1px solid silver;
411 background: #f4f4f4;
412 padding: 0.5em;
415 div.quoteblock-attribution {
416 padding-top: 0.5em;
417 text-align: right;
420 div.verseblock-content {
421 white-space: pre;
423 div.verseblock-attribution {
424 padding-top: 0.75em;
425 text-align: left;
428 div.exampleblock-content {
429 border-left: 3px solid #dddddd;
430 padding-left: 0.5em;
433 /* IE6 sets dynamically generated links as visited. */
434 div#toc a:visited { color: blue; }
435 </style>
436 <script type="text/javascript">
437 /*<![CDATA[*/
438 window.onload = function(){asciidoc.footnotes();}
439 var asciidoc = { // Namespace.
441 /////////////////////////////////////////////////////////////////////
442 // Table Of Contents generator
443 /////////////////////////////////////////////////////////////////////
445 /* Author: Mihai Bazon, September 2002
446 * http://students.infoiasi.ro/~mishoo
448 * Table Of Content generator
449 * Version: 0.4
451 * Feel free to use this script under the terms of the GNU General Public
452 * License, as long as you do not remove or alter this notice.
455 /* modified by Troy D. Hanson, September 2006. License: GPL */
456 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
458 // toclevels = 1..4.
459 toc: function (toclevels) {
461 function getText(el) {
462 var text = "";
463 for (var i = el.firstChild; i != null; i = i.nextSibling) {
464 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
465 text += i.data;
466 else if (i.firstChild != null)
467 text += getText(i);
469 return text;
472 function TocEntry(el, text, toclevel) {
473 this.element = el;
474 this.text = text;
475 this.toclevel = toclevel;
478 function tocEntries(el, toclevels) {
479 var result = new Array;
480 var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
481 // Function that scans the DOM tree for header elements (the DOM2
482 // nodeIterator API would be a better technique but not supported by all
483 // browsers).
484 var iterate = function (el) {
485 for (var i = el.firstChild; i != null; i = i.nextSibling) {
486 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
487 var mo = re.exec(i.tagName);
488 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
489 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
491 iterate(i);
495 iterate(el);
496 return result;
499 var toc = document.getElementById("toc");
500 var entries = tocEntries(document.getElementById("content"), toclevels);
501 for (var i = 0; i < entries.length; ++i) {
502 var entry = entries[i];
503 if (entry.element.id == "")
504 entry.element.id = "_toc_" + i;
505 var a = document.createElement("a");
506 a.href = "#" + entry.element.id;
507 a.appendChild(document.createTextNode(entry.text));
508 var div = document.createElement("div");
509 div.appendChild(a);
510 div.className = "toclevel" + entry.toclevel;
511 toc.appendChild(div);
513 if (entries.length == 0)
514 toc.parentNode.removeChild(toc);
518 /////////////////////////////////////////////////////////////////////
519 // Footnotes generator
520 /////////////////////////////////////////////////////////////////////
522 /* Based on footnote generation code from:
523 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
526 footnotes: function () {
527 var cont = document.getElementById("content");
528 var noteholder = document.getElementById("footnotes");
529 var spans = cont.getElementsByTagName("span");
530 var refs = {};
531 var n = 0;
532 for (i=0; i<spans.length; i++) {
533 if (spans[i].className == "footnote") {
534 n++;
535 // Use [\s\S] in place of . so multi-line matches work.
536 // Because JavaScript has no s (dotall) regex flag.
537 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
538 noteholder.innerHTML +=
539 "<div class='footnote' id='_footnote_" + n + "'>" +
540 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
541 n + "</a>. " + note + "</div>";
542 spans[i].innerHTML =
543 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
544 "' title='View footnote' class='footnote'>" + n + "</a>]";
545 var id =spans[i].getAttribute("id");
546 if (id != null) refs["#"+id] = n;
549 if (n == 0)
550 noteholder.parentNode.removeChild(noteholder);
551 else {
552 // Process footnoterefs.
553 for (i=0; i<spans.length; i++) {
554 if (spans[i].className == "footnoteref") {
555 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
556 href = href.match(/#.*/)[0]; // Because IE return full URL.
557 n = refs[href];
558 spans[i].innerHTML =
559 "[<a href='#_footnote_" + n +
560 "' title='View footnote' class='footnote'>" + n + "</a>]";
567 /*]]>*/
568 </script>
569 </head>
570 <body>
571 <div id="header">
572 <h1>
573 git-svn(1) Manual Page
574 </h1>
575 <h2>NAME</h2>
576 <div class="sectionbody">
577 <p>git-svn -
578 Bidirectional operation between a Subversion repository and git
579 </p>
580 </div>
581 </div>
582 <div id="content">
583 <h2 id="_synopsis">SYNOPSIS</h2>
584 <div class="sectionbody">
585 <div class="verseblock">
586 <div class="verseblock-content"><em>git svn</em> &lt;command&gt; [options] [arguments]</div>
587 <div class="verseblock-attribution">
588 </div></div>
589 </div>
590 <h2 id="_description">DESCRIPTION</h2>
591 <div class="sectionbody">
592 <div class="paragraph"><p><em>git svn</em> is a simple conduit for changesets between Subversion and git.
593 It provides a bidirectional flow of changes between a Subversion and a git
594 repository.</p></div>
595 <div class="paragraph"><p><em>git svn</em> can track a standard Subversion repository,
596 following the common "trunk/branches/tags" layout, with the --stdlayout option.
597 It can also follow branches and tags in any layout with the -T/-t/-b options
598 (see options to <em>init</em> below, and also the <em>clone</em> command).</p></div>
599 <div class="paragraph"><p>Once tracking a Subversion repository (with any of the above methods), the git
600 repository can be updated from Subversion by the <em>fetch</em> command and
601 Subversion updated from git by the <em>dcommit</em> command.</p></div>
602 </div>
603 <h2 id="_commands">COMMANDS</h2>
604 <div class="sectionbody">
605 <div class="dlist"><dl>
606 <dt class="hdlist1">
607 <em>init</em>
608 </dt>
609 <dd>
611 Initializes an empty git repository with additional
612 metadata directories for <em>git svn</em>. The Subversion URL
613 may be specified as a command-line argument, or as full
614 URL arguments to -T/-t/-b. Optionally, the target
615 directory to operate on can be specified as a second
616 argument. Normally this command initializes the current
617 directory.
618 </p>
619 <div class="dlist"><dl>
620 <dt class="hdlist1">
621 -T&lt;trunk_subdir&gt;
622 </dt>
623 <dt class="hdlist1">
624 --trunk=&lt;trunk_subdir&gt;
625 </dt>
626 <dt class="hdlist1">
627 -t&lt;tags_subdir&gt;
628 </dt>
629 <dt class="hdlist1">
630 --tags=&lt;tags_subdir&gt;
631 </dt>
632 <dt class="hdlist1">
633 -b&lt;branches_subdir&gt;
634 </dt>
635 <dt class="hdlist1">
636 --branches=&lt;branches_subdir&gt;
637 </dt>
638 <dt class="hdlist1">
640 </dt>
641 <dt class="hdlist1">
642 --stdlayout
643 </dt>
644 <dd>
646 These are optional command-line options for init. Each of
647 these flags can point to a relative repository path
648 (--tags=project/tags) or a full url
649 (--tags=https://foo.org/project/tags).
650 You can specify more than one --tags and/or --branches options, in case
651 your Subversion repository places tags or branches under multiple paths.
652 The option --stdlayout is
653 a shorthand way of setting trunk,tags,branches as the relative paths,
654 which is the Subversion default. If any of the other options are given
655 as well, they take precedence.
656 </p>
657 </dd>
658 <dt class="hdlist1">
659 --no-metadata
660 </dt>
661 <dd>
663 Set the <em>noMetadata</em> option in the [svn-remote] config.
664 This option is not recommended, please read the <em>svn.noMetadata</em>
665 section of this manpage before using this option.
666 </p>
667 </dd>
668 <dt class="hdlist1">
669 --use-svm-props
670 </dt>
671 <dd>
673 Set the <em>useSvmProps</em> option in the [svn-remote] config.
674 </p>
675 </dd>
676 <dt class="hdlist1">
677 --use-svnsync-props
678 </dt>
679 <dd>
681 Set the <em>useSvnsyncProps</em> option in the [svn-remote] config.
682 </p>
683 </dd>
684 <dt class="hdlist1">
685 --rewrite-root=&lt;URL&gt;
686 </dt>
687 <dd>
689 Set the <em>rewriteRoot</em> option in the [svn-remote] config.
690 </p>
691 </dd>
692 <dt class="hdlist1">
693 --rewrite-uuid=&lt;UUID&gt;
694 </dt>
695 <dd>
697 Set the <em>rewriteUUID</em> option in the [svn-remote] config.
698 </p>
699 </dd>
700 <dt class="hdlist1">
701 --username=&lt;user&gt;
702 </dt>
703 <dd>
705 For transports that SVN handles authentication for (http,
706 https, and plain svn), specify the username. For other
707 transports (eg svn+ssh://), you must include the username in
708 the URL, eg svn+ssh://foo@svn.bar.com/project
709 </p>
710 </dd>
711 <dt class="hdlist1">
712 --prefix=&lt;prefix&gt;
713 </dt>
714 <dd>
716 This allows one to specify a prefix which is prepended
717 to the names of remotes if trunk/branches/tags are
718 specified. The prefix does not automatically include a
719 trailing slash, so be sure you include one in the
720 argument if that is what you want. If --branches/-b is
721 specified, the prefix must include a trailing slash.
722 Setting a prefix is useful if you wish to track multiple
723 projects that share a common repository.
724 </p>
725 </dd>
726 <dt class="hdlist1">
727 --ignore-paths=&lt;regex&gt;
728 </dt>
729 <dd>
731 When passed to <em>init</em> or <em>clone</em> this regular expression will
732 be preserved as a config key. See <em>fetch</em> for a description
733 of <em>--ignore-paths</em>.
734 </p>
735 </dd>
736 <dt class="hdlist1">
737 --no-minimize-url
738 </dt>
739 <dd>
741 When tracking multiple directories (using --stdlayout,
742 --branches, or --tags options), git svn will attempt to connect
743 to the root (or highest allowed level) of the Subversion
744 repository. This default allows better tracking of history if
745 entire projects are moved within a repository, but may cause
746 issues on repositories where read access restrictions are in
747 place. Passing <em>--no-minimize-url</em> will allow git svn to
748 accept URLs as-is without attempting to connect to a higher
749 level directory. This option is off by default when only
750 one URL/branch is tracked (it would do little good).
751 </p>
752 </dd>
753 </dl></div>
754 </dd>
755 <dt class="hdlist1">
756 <em>fetch</em>
757 </dt>
758 <dd>
760 Fetch unfetched revisions from the Subversion remote we are
761 tracking. The name of the [svn-remote "&#8230;"] section in the
762 .git/config file may be specified as an optional command-line
763 argument.
764 </p>
765 <div class="dlist"><dl>
766 <dt class="hdlist1">
767 --localtime
768 </dt>
769 <dd>
771 Store Git commit times in the local timezone instead of UTC. This
772 makes <em>git log</em> (even without --date=local) show the same times
773 that <tt>svn log</tt> would in the local timezone.
774 </p>
775 <div class="paragraph"><p>This doesn&#8217;t interfere with interoperating with the Subversion
776 repository you cloned from, but if you wish for your local Git
777 repository to be able to interoperate with someone else&#8217;s local Git
778 repository, either don&#8217;t use this option or you should both use it in
779 the same local timezone.</p></div>
780 </dd>
781 <dt class="hdlist1">
782 --parent
783 </dt>
784 <dd>
786 Fetch only from the SVN parent of the current HEAD.
787 </p>
788 </dd>
789 <dt class="hdlist1">
790 --ignore-paths=&lt;regex&gt;
791 </dt>
792 <dd>
794 This allows one to specify a Perl regular expression that will
795 cause skipping of all matching paths from checkout from SVN.
796 The <em>--ignore-paths</em> option should match for every <em>fetch</em>
797 (including automatic fetches due to <em>clone</em>, <em>dcommit</em>,
798 <em>rebase</em>, etc) on a given repository.
799 </p>
800 <div class="verseblock">
801 <div class="verseblock-content">config key: svn-remote.&lt;name&gt;.ignore-paths</div>
802 <div class="verseblock-attribution">
803 </div></div>
804 <div class="paragraph"><p>If the ignore-paths config key is set and the command line option is
805 also given, both regular expressions will be used.</p></div>
806 <div class="paragraph"><p>Examples:</p></div>
807 <div class="dlist"><dl>
808 <dt class="hdlist1">
809 Skip "doc*" directory for every fetch
810 </dt>
811 <dd>
812 <div class="listingblock">
813 <div class="content">
814 <pre><tt>--ignore-paths="^doc"</tt></pre>
815 </div></div>
816 </dd>
817 <dt class="hdlist1">
818 Skip "branches" and "tags" of first level directories
819 </dt>
820 <dd>
821 <div class="listingblock">
822 <div class="content">
823 <pre><tt>--ignore-paths="^[^/]+/(?:branches|tags)"</tt></pre>
824 </div></div>
825 </dd>
826 </dl></div>
827 </dd>
828 </dl></div>
829 </dd>
830 <dt class="hdlist1">
831 <em>clone</em>
832 </dt>
833 <dd>
835 Runs <em>init</em> and <em>fetch</em>. It will automatically create a
836 directory based on the basename of the URL passed to it;
837 or if a second argument is passed; it will create a directory
838 and work within that. It accepts all arguments that the
839 <em>init</em> and <em>fetch</em> commands accept; with the exception of
840 <em>--fetch-all</em> and <em>--parent</em>. After a repository is cloned,
841 the <em>fetch</em> command will be able to update revisions without
842 affecting the working tree; and the <em>rebase</em> command will be
843 able to update the working tree with the latest changes.
844 </p>
845 <div class="dlist"><dl>
846 <dt class="hdlist1">
847 --preserve-empty-dirs
848 </dt>
849 <dd>
851 Create a placeholder file in the local Git repository for each
852 empty directory fetched from Subversion. This includes directories
853 that become empty by removing all entries in the Subversion
854 repository (but not the directory itself). The placeholder files
855 are also tracked and removed when no longer necessary.
856 </p>
857 </dd>
858 <dt class="hdlist1">
859 --placeholder-filename=&lt;filename&gt;
860 </dt>
861 <dd>
863 Set the name of placeholder files created by --preserve-empty-dirs.
864 Default: ".gitignore"
865 </p>
866 </dd>
867 </dl></div>
868 </dd>
869 <dt class="hdlist1">
870 <em>rebase</em>
871 </dt>
872 <dd>
874 This fetches revisions from the SVN parent of the current HEAD
875 and rebases the current (uncommitted to SVN) work against it.
876 </p>
877 <div class="paragraph"><p>This works similarly to <tt>svn update</tt> or <em>git pull</em> except that
878 it preserves linear history with <em>git rebase</em> instead of
879 <em>git merge</em> for ease of dcommitting with <em>git svn</em>.</p></div>
880 <div class="paragraph"><p>This accepts all options that <em>git svn fetch</em> and <em>git rebase</em>
881 accept. However, <em>--fetch-all</em> only fetches from the current
882 [svn-remote], and not all [svn-remote] definitions.</p></div>
883 <div class="paragraph"><p>Like <em>git rebase</em>; this requires that the working tree be clean
884 and have no uncommitted changes.</p></div>
885 <div class="dlist"><dl>
886 <dt class="hdlist1">
888 </dt>
889 <dt class="hdlist1">
890 --local
891 </dt>
892 <dd>
894 Do not fetch remotely; only run <em>git rebase</em> against the
895 last fetched commit from the upstream SVN.
896 </p>
897 </dd>
898 </dl></div>
899 </dd>
900 <dt class="hdlist1">
901 <em>dcommit</em>
902 </dt>
903 <dd>
905 Commit each diff from a specified head directly to the SVN
906 repository, and then rebase or reset (depending on whether or
907 not there is a diff between SVN and head). This will create
908 a revision in SVN for each commit in git.
909 It is recommended that you run <em>git svn</em> fetch and rebase (not
910 pull or merge) your commits against the latest changes in the
911 SVN repository.
912 An optional revision or branch argument may be specified, and
913 causes <em>git svn</em> to do all work on that revision/branch
914 instead of HEAD.
915 This is advantageous over <em>set-tree</em> (below) because it produces
916 cleaner, more linear history.
917 </p>
918 <div class="dlist"><dl>
919 <dt class="hdlist1">
920 --no-rebase
921 </dt>
922 <dd>
924 After committing, do not rebase or reset.
925 </p>
926 </dd>
927 <dt class="hdlist1">
928 --commit-url &lt;URL&gt;
929 </dt>
930 <dd>
932 Commit to this SVN URL (the full path). This is intended to
933 allow existing <em>git svn</em> repositories created with one transport
934 method (e.g. <tt>svn://</tt> or <tt>http://</tt> for anonymous read) to be
935 reused if a user is later given access to an alternate transport
936 method (e.g. <tt>svn+ssh://</tt> or <tt>https://</tt>) for commit.
937 </p>
938 <div class="verseblock">
939 <div class="verseblock-content">config key: svn-remote.&lt;name&gt;.commiturl
940 config key: svn.commiturl (overwrites all svn-remote.&lt;name&gt;.commiturl options)</div>
941 <div class="verseblock-attribution">
942 </div></div>
943 <div class="paragraph"><p>Using this option for any other purpose (don&#8217;t ask) is very strongly
944 discouraged.</p></div>
945 </dd>
946 <dt class="hdlist1">
947 --mergeinfo=&lt;mergeinfo&gt;
948 </dt>
949 <dd>
951 Add the given merge information during the dcommit
952 (e.g. <tt>--mergeinfo="/branches/foo:1-10"</tt>). All svn server versions can
953 store this information (as a property), and svn clients starting from
954 version 1.5 can make use of it. To specify merge information from multiple
955 branches, use a single space character between the branches
956 (<tt>--mergeinfo="/branches/foo:1-10 /branches/bar:3,5-6,8"</tt>)
957 </p>
958 <div class="verseblock">
959 <div class="verseblock-content">config key: svn.pushmergeinfo</div>
960 <div class="verseblock-attribution">
961 </div></div>
962 <div class="paragraph"><p>This option will cause git-svn to attempt to automatically populate the
963 svn:mergeinfo property in the SVN repository when possible. Currently, this can
964 only be done when dcommitting non-fast-forward merges where all parents but the
965 first have already been pushed into SVN.</p></div>
966 </dd>
967 <dt class="hdlist1">
968 --interactive
969 </dt>
970 <dd>
972 Ask the user to confirm that a patch set should actually be sent to SVN.
973 For each patch, one may answer "yes" (accept this patch), "no" (discard this
974 patch), "all" (accept all patches), or "quit".
975 <br />
976 <em>git svn dcommit</em> returns immediately if answer if "no" or "quit", without
977 commiting anything to SVN.
978 </p>
979 </dd>
980 </dl></div>
981 </dd>
982 <dt class="hdlist1">
983 <em>branch</em>
984 </dt>
985 <dd>
987 Create a branch in the SVN repository.
988 </p>
989 <div class="dlist"><dl>
990 <dt class="hdlist1">
992 </dt>
993 <dt class="hdlist1">
994 --message
995 </dt>
996 <dd>
998 Allows to specify the commit message.
999 </p>
1000 </dd>
1001 <dt class="hdlist1">
1003 </dt>
1004 <dt class="hdlist1">
1005 --tag
1006 </dt>
1007 <dd>
1009 Create a tag by using the tags_subdir instead of the branches_subdir
1010 specified during git svn init.
1011 </p>
1012 </dd>
1013 <dt class="hdlist1">
1015 </dt>
1016 <dt class="hdlist1">
1017 --destination
1018 </dt>
1019 <dd>
1021 If more than one --branches (or --tags) option was given to the <em>init</em>
1022 or <em>clone</em> command, you must provide the location of the branch (or
1023 tag) you wish to create in the SVN repository. The value of this
1024 option must match one of the paths specified by a --branches (or
1025 --tags) option. You can see these paths with the commands
1026 </p>
1027 <div class="literalblock">
1028 <div class="content">
1029 <pre><tt>git config --get-all svn-remote.&lt;name&gt;.branches
1030 git config --get-all svn-remote.&lt;name&gt;.tags</tt></pre>
1031 </div></div>
1032 <div class="paragraph"><p>where &lt;name&gt; is the name of the SVN repository as specified by the -R option to
1033 <em>init</em> (or "svn" by default).</p></div>
1034 </dd>
1035 <dt class="hdlist1">
1036 --username
1037 </dt>
1038 <dd>
1040 Specify the SVN username to perform the commit as. This option overrides
1041 the <em>username</em> configuration property.
1042 </p>
1043 </dd>
1044 <dt class="hdlist1">
1045 --commit-url
1046 </dt>
1047 <dd>
1049 Use the specified URL to connect to the destination Subversion
1050 repository. This is useful in cases where the source SVN
1051 repository is read-only. This option overrides configuration
1052 property <em>commiturl</em>.
1053 </p>
1054 <div class="literalblock">
1055 <div class="content">
1056 <pre><tt>git config --get-all svn-remote.&lt;name&gt;.commiturl</tt></pre>
1057 </div></div>
1058 </dd>
1059 </dl></div>
1060 </dd>
1061 <dt class="hdlist1">
1062 <em>tag</em>
1063 </dt>
1064 <dd>
1066 Create a tag in the SVN repository. This is a shorthand for
1067 <em>branch -t</em>.
1068 </p>
1069 </dd>
1070 <dt class="hdlist1">
1071 <em>log</em>
1072 </dt>
1073 <dd>
1075 This should make it easy to look up svn log messages when svn
1076 users refer to -r/--revision numbers.
1077 </p>
1078 <div class="paragraph"><p>The following features from &#8216;svn log&#8217; are supported:</p></div>
1079 <div class="dlist"><dl>
1080 <dt class="hdlist1">
1081 -r &lt;n&gt;[:&lt;n&gt;]
1082 </dt>
1083 <dt class="hdlist1">
1084 --revision=&lt;n&gt;[:&lt;n&gt;]
1085 </dt>
1086 <dd>
1088 is supported, non-numeric args are not:
1089 HEAD, NEXT, BASE, PREV, etc &#8230;
1090 </p>
1091 </dd>
1092 <dt class="hdlist1">
1094 </dt>
1095 <dt class="hdlist1">
1096 --verbose
1097 </dt>
1098 <dd>
1100 it&#8217;s not completely compatible with the --verbose
1101 output in svn log, but reasonably close.
1102 </p>
1103 </dd>
1104 <dt class="hdlist1">
1105 --limit=&lt;n&gt;
1106 </dt>
1107 <dd>
1109 is NOT the same as --max-count, doesn&#8217;t count
1110 merged/excluded commits
1111 </p>
1112 </dd>
1113 <dt class="hdlist1">
1114 --incremental
1115 </dt>
1116 <dd>
1118 supported
1119 </p>
1120 </dd>
1121 </dl></div>
1122 <div class="paragraph"><p>New features:</p></div>
1123 <div class="dlist"><dl>
1124 <dt class="hdlist1">
1125 --show-commit
1126 </dt>
1127 <dd>
1129 shows the git commit sha1, as well
1130 </p>
1131 </dd>
1132 <dt class="hdlist1">
1133 --oneline
1134 </dt>
1135 <dd>
1137 our version of --pretty=oneline
1138 </p>
1139 </dd>
1140 </dl></div>
1141 <div class="admonitionblock">
1142 <table><tr>
1143 <td class="icon">
1144 <div class="title">Note</div>
1145 </td>
1146 <td class="content">SVN itself only stores times in UTC and nothing else. The regular svn
1147 client converts the UTC time to the local time (or based on the TZ=
1148 environment). This command has the same behaviour.</td>
1149 </tr></table>
1150 </div>
1151 <div class="paragraph"><p>Any other arguments are passed directly to <em>git log</em></p></div>
1152 </dd>
1153 <dt class="hdlist1">
1154 <em>blame</em>
1155 </dt>
1156 <dd>
1158 Show what revision and author last modified each line of a file. The
1159 output of this mode is format-compatible with the output of
1160 &#8216;svn blame&#8217; by default. Like the SVN blame command,
1161 local uncommitted changes in the working tree are ignored;
1162 the version of the file in the HEAD revision is annotated. Unknown
1163 arguments are passed directly to <em>git blame</em>.
1164 </p>
1165 <div class="dlist"><dl>
1166 <dt class="hdlist1">
1167 --git-format
1168 </dt>
1169 <dd>
1171 Produce output in the same format as <em>git blame</em>, but with
1172 SVN revision numbers instead of git commit hashes. In this mode,
1173 changes that haven&#8217;t been committed to SVN (including local
1174 working-copy edits) are shown as revision 0.
1175 </p>
1176 </dd>
1177 </dl></div>
1178 </dd>
1179 <dt class="hdlist1">
1180 <em>find-rev</em>
1181 </dt>
1182 <dd>
1184 When given an SVN revision number of the form <em>rN</em>, returns the
1185 corresponding git commit hash (this can optionally be followed by a
1186 tree-ish to specify which branch should be searched). When given a
1187 tree-ish, returns the corresponding SVN revision number.
1188 </p>
1189 </dd>
1190 <dt class="hdlist1">
1191 <em>set-tree</em>
1192 </dt>
1193 <dd>
1195 You should consider using <em>dcommit</em> instead of this command.
1196 Commit specified commit or tree objects to SVN. This relies on
1197 your imported fetch data being up-to-date. This makes
1198 absolutely no attempts to do patching when committing to SVN, it
1199 simply overwrites files with those specified in the tree or
1200 commit. All merging is assumed to have taken place
1201 independently of <em>git svn</em> functions.
1202 </p>
1203 </dd>
1204 <dt class="hdlist1">
1205 <em>create-ignore</em>
1206 </dt>
1207 <dd>
1209 Recursively finds the svn:ignore property on directories and
1210 creates matching .gitignore files. The resulting files are staged to
1211 be committed, but are not committed. Use -r/--revision to refer to a
1212 specific revision.
1213 </p>
1214 </dd>
1215 <dt class="hdlist1">
1216 <em>show-ignore</em>
1217 </dt>
1218 <dd>
1220 Recursively finds and lists the svn:ignore property on
1221 directories. The output is suitable for appending to
1222 the $GIT_DIR/info/exclude file.
1223 </p>
1224 </dd>
1225 <dt class="hdlist1">
1226 <em>mkdirs</em>
1227 </dt>
1228 <dd>
1230 Attempts to recreate empty directories that core git cannot track
1231 based on information in $GIT_DIR/svn/&lt;refname&gt;/unhandled.log files.
1232 Empty directories are automatically recreated when using
1233 "git svn clone" and "git svn rebase", so "mkdirs" is intended
1234 for use after commands like "git checkout" or "git reset".
1235 (See the svn-remote.&lt;name&gt;.automkdirs config file option for
1236 more information.)
1237 </p>
1238 </dd>
1239 <dt class="hdlist1">
1240 <em>commit-diff</em>
1241 </dt>
1242 <dd>
1244 Commits the diff of two tree-ish arguments from the
1245 command-line. This command does not rely on being inside an <tt>git svn
1246 init</tt>-ed repository. This command takes three arguments, (a) the
1247 original tree to diff against, (b) the new tree result, (c) the
1248 URL of the target Subversion repository. The final argument
1249 (URL) may be omitted if you are working from a <em>git svn</em>-aware
1250 repository (that has been <tt>init</tt>-ed with <em>git svn</em>).
1251 The -r&lt;revision&gt; option is required for this.
1252 </p>
1253 </dd>
1254 <dt class="hdlist1">
1255 <em>info</em>
1256 </dt>
1257 <dd>
1259 Shows information about a file or directory similar to what
1260 &#8216;svn info&#8217; provides. Does not currently support a -r/--revision
1261 argument. Use the --url option to output only the value of the
1262 <em>URL:</em> field.
1263 </p>
1264 </dd>
1265 <dt class="hdlist1">
1266 <em>proplist</em>
1267 </dt>
1268 <dd>
1270 Lists the properties stored in the Subversion repository about a
1271 given file or directory. Use -r/--revision to refer to a specific
1272 Subversion revision.
1273 </p>
1274 </dd>
1275 <dt class="hdlist1">
1276 <em>propget</em>
1277 </dt>
1278 <dd>
1280 Gets the Subversion property given as the first argument, for a
1281 file. A specific revision can be specified with -r/--revision.
1282 </p>
1283 </dd>
1284 <dt class="hdlist1">
1285 <em>show-externals</em>
1286 </dt>
1287 <dd>
1289 Shows the Subversion externals. Use -r/--revision to specify a
1290 specific revision.
1291 </p>
1292 </dd>
1293 <dt class="hdlist1">
1294 <em>gc</em>
1295 </dt>
1296 <dd>
1298 Compress $GIT_DIR/svn/&lt;refname&gt;/unhandled.log files in .git/svn
1299 and remove $GIT_DIR/svn/&lt;refname&gt;index files in .git/svn.
1300 </p>
1301 </dd>
1302 <dt class="hdlist1">
1303 <em>reset</em>
1304 </dt>
1305 <dd>
1307 Undoes the effects of <em>fetch</em> back to the specified revision.
1308 This allows you to re-<em>fetch</em> an SVN revision. Normally the
1309 contents of an SVN revision should never change and <em>reset</em>
1310 should not be necessary. However, if SVN permissions change,
1311 or if you alter your --ignore-paths option, a <em>fetch</em> may fail
1312 with "not found in commit" (file not previously visible) or
1313 "checksum mismatch" (missed a modification). If the problem
1314 file cannot be ignored forever (with --ignore-paths) the only
1315 way to repair the repo is to use <em>reset</em>.
1316 </p>
1317 <div class="paragraph"><p>Only the rev_map and refs/remotes/git-svn are changed. Follow <em>reset</em>
1318 with a <em>fetch</em> and then <em>git reset</em> or <em>git rebase</em> to move local
1319 branches onto the new tree.</p></div>
1320 <div class="dlist"><dl>
1321 <dt class="hdlist1">
1322 -r &lt;n&gt;
1323 </dt>
1324 <dt class="hdlist1">
1325 --revision=&lt;n&gt;
1326 </dt>
1327 <dd>
1329 Specify the most recent revision to keep. All later revisions
1330 are discarded.
1331 </p>
1332 </dd>
1333 <dt class="hdlist1">
1335 </dt>
1336 <dt class="hdlist1">
1337 --parent
1338 </dt>
1339 <dd>
1341 Discard the specified revision as well, keeping the nearest
1342 parent instead.
1343 </p>
1344 </dd>
1345 <dt class="hdlist1">
1346 Example:
1347 </dt>
1348 <dd>
1350 Assume you have local changes in "master", but you need to refetch "r2".
1351 </p>
1352 <div class="listingblock">
1353 <div class="content">
1354 <pre><tt> r1---r2---r3 remotes/git-svn
1356 A---B master</tt></pre>
1357 </div></div>
1358 <div class="paragraph"><p>Fix the ignore-paths or SVN permissions problem that caused "r2" to
1359 be incomplete in the first place. Then:</p></div>
1360 <div class="verseblock">
1361 <div class="verseblock-content">git svn reset -r2 -p
1362 git svn fetch</div>
1363 <div class="verseblock-attribution">
1364 </div></div>
1365 <div class="listingblock">
1366 <div class="content">
1367 <pre><tt> r1---r2'--r3' remotes/git-svn
1369 r2---r3---A---B master</tt></pre>
1370 </div></div>
1371 <div class="paragraph"><p>Then fixup "master" with <em>git rebase</em>.
1372 Do NOT use <em>git merge</em> or your history will not be compatible with a
1373 future <em>dcommit</em>!</p></div>
1374 <div class="verseblock">
1375 <div class="verseblock-content">git rebase --onto remotes/git-svn A^ master</div>
1376 <div class="verseblock-attribution">
1377 </div></div>
1378 <div class="listingblock">
1379 <div class="content">
1380 <pre><tt> r1---r2'--r3' remotes/git-svn
1382 A'--B' master</tt></pre>
1383 </div></div>
1384 </dd>
1385 </dl></div>
1386 </dd>
1387 </dl></div>
1388 </div>
1389 <h2 id="_options">OPTIONS</h2>
1390 <div class="sectionbody">
1391 <div class="dlist"><dl>
1392 <dt class="hdlist1">
1393 --shared[=(false|true|umask|group|all|world|everybody)]
1394 </dt>
1395 <dt class="hdlist1">
1396 --template=&lt;template_directory&gt;
1397 </dt>
1398 <dd>
1400 Only used with the <em>init</em> command.
1401 These are passed directly to <em>git init</em>.
1402 </p>
1403 </dd>
1404 <dt class="hdlist1">
1405 -r &lt;arg&gt;
1406 </dt>
1407 <dt class="hdlist1">
1408 --revision &lt;arg&gt;
1409 </dt>
1410 <dd>
1412 Used with the <em>fetch</em> command.
1413 </p>
1414 <div class="paragraph"><p>This allows revision ranges for partial/cauterized history
1415 to be supported. $NUMBER, $NUMBER1:$NUMBER2 (numeric ranges),
1416 $NUMBER:HEAD, and BASE:$NUMBER are all supported.</p></div>
1417 <div class="paragraph"><p>This can allow you to make partial mirrors when running fetch;
1418 but is generally not recommended because history will be skipped
1419 and lost.</p></div>
1420 </dd>
1421 <dt class="hdlist1">
1423 </dt>
1424 <dt class="hdlist1">
1425 --stdin
1426 </dt>
1427 <dd>
1429 Only used with the <em>set-tree</em> command.
1430 </p>
1431 <div class="paragraph"><p>Read a list of commits from stdin and commit them in reverse
1432 order. Only the leading sha1 is read from each line, so
1433 <em>git rev-list --pretty=oneline</em> output can be used.</p></div>
1434 </dd>
1435 <dt class="hdlist1">
1436 --rmdir
1437 </dt>
1438 <dd>
1440 Only used with the <em>dcommit</em>, <em>set-tree</em> and <em>commit-diff</em> commands.
1441 </p>
1442 <div class="paragraph"><p>Remove directories from the SVN tree if there are no files left
1443 behind. SVN can version empty directories, and they are not
1444 removed by default if there are no files left in them. git
1445 cannot version empty directories. Enabling this flag will make
1446 the commit to SVN act like git.</p></div>
1447 <div class="verseblock">
1448 <div class="verseblock-content">config key: svn.rmdir</div>
1449 <div class="verseblock-attribution">
1450 </div></div>
1451 </dd>
1452 <dt class="hdlist1">
1454 </dt>
1455 <dt class="hdlist1">
1456 --edit
1457 </dt>
1458 <dd>
1460 Only used with the <em>dcommit</em>, <em>set-tree</em> and <em>commit-diff</em> commands.
1461 </p>
1462 <div class="paragraph"><p>Edit the commit message before committing to SVN. This is off by
1463 default for objects that are commits, and forced on when committing
1464 tree objects.</p></div>
1465 <div class="verseblock">
1466 <div class="verseblock-content">config key: svn.edit</div>
1467 <div class="verseblock-attribution">
1468 </div></div>
1469 </dd>
1470 <dt class="hdlist1">
1471 -l&lt;num&gt;
1472 </dt>
1473 <dt class="hdlist1">
1474 --find-copies-harder
1475 </dt>
1476 <dd>
1478 Only used with the <em>dcommit</em>, <em>set-tree</em> and <em>commit-diff</em> commands.
1479 </p>
1480 <div class="paragraph"><p>They are both passed directly to <em>git diff-tree</em>; see
1481 <a href="git-diff-tree.html">git-diff-tree(1)</a> for more information.</p></div>
1482 <div class="verseblock">
1483 <div class="verseblock-content">config key: svn.l
1484 config key: svn.findcopiesharder</div>
1485 <div class="verseblock-attribution">
1486 </div></div>
1487 </dd>
1488 <dt class="hdlist1">
1489 -A&lt;filename&gt;
1490 </dt>
1491 <dt class="hdlist1">
1492 --authors-file=&lt;filename&gt;
1493 </dt>
1494 <dd>
1496 Syntax is compatible with the file used by <em>git cvsimport</em>:
1497 </p>
1498 <div class="listingblock">
1499 <div class="content">
1500 <pre><tt> loginname = Joe User &lt;user@example.com&gt;</tt></pre>
1501 </div></div>
1502 <div class="paragraph"><p>If this option is specified and <em>git svn</em> encounters an SVN
1503 committer name that does not exist in the authors-file, <em>git svn</em>
1504 will abort operation. The user will then have to add the
1505 appropriate entry. Re-running the previous <em>git svn</em> command
1506 after the authors-file is modified should continue operation.</p></div>
1507 <div class="verseblock">
1508 <div class="verseblock-content">config key: svn.authorsfile</div>
1509 <div class="verseblock-attribution">
1510 </div></div>
1511 </dd>
1512 <dt class="hdlist1">
1513 --authors-prog=&lt;filename&gt;
1514 </dt>
1515 <dd>
1517 If this option is specified, for each SVN committer name that
1518 does not exist in the authors file, the given file is executed
1519 with the committer name as the first argument. The program is
1520 expected to return a single line of the form "Name &lt;email&gt;",
1521 which will be treated as if included in the authors file.
1522 </p>
1523 </dd>
1524 <dt class="hdlist1">
1526 </dt>
1527 <dt class="hdlist1">
1528 --quiet
1529 </dt>
1530 <dd>
1532 Make <em>git svn</em> less verbose. Specify a second time to make it
1533 even less verbose.
1534 </p>
1535 </dd>
1536 <dt class="hdlist1">
1537 --repack[=&lt;n&gt;]
1538 </dt>
1539 <dt class="hdlist1">
1540 --repack-flags=&lt;flags&gt;
1541 </dt>
1542 <dd>
1544 These should help keep disk usage sane for large fetches with
1545 many revisions.
1546 </p>
1547 <div class="paragraph"><p>--repack takes an optional argument for the number of revisions
1548 to fetch before repacking. This defaults to repacking every
1549 1000 commits fetched if no argument is specified.</p></div>
1550 <div class="paragraph"><p>--repack-flags are passed directly to <em>git repack</em>.</p></div>
1551 <div class="verseblock">
1552 <div class="verseblock-content">config key: svn.repack
1553 config key: svn.repackflags</div>
1554 <div class="verseblock-attribution">
1555 </div></div>
1556 </dd>
1557 <dt class="hdlist1">
1559 </dt>
1560 <dt class="hdlist1">
1561 --merge
1562 </dt>
1563 <dt class="hdlist1">
1564 -s&lt;strategy&gt;
1565 </dt>
1566 <dt class="hdlist1">
1567 --strategy=&lt;strategy&gt;
1568 </dt>
1569 <dd>
1571 These are only used with the <em>dcommit</em> and <em>rebase</em> commands.
1572 </p>
1573 <div class="paragraph"><p>Passed directly to <em>git rebase</em> when using <em>dcommit</em> if a
1574 <em>git reset</em> cannot be used (see <em>dcommit</em>).</p></div>
1575 </dd>
1576 <dt class="hdlist1">
1578 </dt>
1579 <dt class="hdlist1">
1580 --dry-run
1581 </dt>
1582 <dd>
1584 This can be used with the <em>dcommit</em>, <em>rebase</em>, <em>branch</em> and
1585 <em>tag</em> commands.
1586 </p>
1587 <div class="paragraph"><p>For <em>dcommit</em>, print out the series of git arguments that would show
1588 which diffs would be committed to SVN.</p></div>
1589 <div class="paragraph"><p>For <em>rebase</em>, display the local branch associated with the upstream svn
1590 repository associated with the current branch and the URL of svn
1591 repository that will be fetched from.</p></div>
1592 <div class="paragraph"><p>For <em>branch</em> and <em>tag</em>, display the urls that will be used for copying when
1593 creating the branch or tag.</p></div>
1594 </dd>
1595 <dt class="hdlist1">
1596 --use-log-author
1597 </dt>
1598 <dd>
1600 When retrieving svn commits into git (as part of <em>fetch</em>, <em>rebase</em>, or
1601 <em>dcommit</em> operations), look for the first <tt>From:</tt> or <tt>Signed-off-by:</tt> line
1602 in the log message and use that as the author string.
1603 </p>
1604 </dd>
1605 <dt class="hdlist1">
1606 --add-author-from
1607 </dt>
1608 <dd>
1610 When committing to svn from git (as part of <em>commit-diff</em>, <em>set-tree</em> or <em>dcommit</em>
1611 operations), if the existing log message doesn&#8217;t already have a
1612 <tt>From:</tt> or <tt>Signed-off-by:</tt> line, append a <tt>From:</tt> line based on the
1613 git commit&#8217;s author string. If you use this, then <tt>--use-log-author</tt>
1614 will retrieve a valid author string for all commits.
1615 </p>
1616 </dd>
1617 </dl></div>
1618 </div>
1619 <h2 id="_advanced_options">ADVANCED OPTIONS</h2>
1620 <div class="sectionbody">
1621 <div class="dlist"><dl>
1622 <dt class="hdlist1">
1623 -i&lt;GIT_SVN_ID&gt;
1624 </dt>
1625 <dt class="hdlist1">
1626 --id &lt;GIT_SVN_ID&gt;
1627 </dt>
1628 <dd>
1630 This sets GIT_SVN_ID (instead of using the environment). This
1631 allows the user to override the default refname to fetch from
1632 when tracking a single URL. The <em>log</em> and <em>dcommit</em> commands
1633 no longer require this switch as an argument.
1634 </p>
1635 </dd>
1636 <dt class="hdlist1">
1637 -R&lt;remote name&gt;
1638 </dt>
1639 <dt class="hdlist1">
1640 --svn-remote &lt;remote name&gt;
1641 </dt>
1642 <dd>
1644 Specify the [svn-remote "&lt;remote name&gt;"] section to use,
1645 this allows SVN multiple repositories to be tracked.
1646 Default: "svn"
1647 </p>
1648 </dd>
1649 <dt class="hdlist1">
1650 --follow-parent
1651 </dt>
1652 <dd>
1654 This is especially helpful when we&#8217;re tracking a directory
1655 that has been moved around within the repository, or if we
1656 started tracking a branch and never tracked the trunk it was
1657 descended from. This feature is enabled by default, use
1658 --no-follow-parent to disable it.
1659 </p>
1660 <div class="verseblock">
1661 <div class="verseblock-content">config key: svn.followparent</div>
1662 <div class="verseblock-attribution">
1663 </div></div>
1664 </dd>
1665 </dl></div>
1666 </div>
1667 <h2 id="_config_file_only_options">CONFIG FILE-ONLY OPTIONS</h2>
1668 <div class="sectionbody">
1669 <div class="dlist"><dl>
1670 <dt class="hdlist1">
1671 svn.noMetadata
1672 </dt>
1673 <dt class="hdlist1">
1674 svn-remote.&lt;name&gt;.noMetadata
1675 </dt>
1676 <dd>
1678 This gets rid of the <em>git-svn-id:</em> lines at the end of every commit.
1679 </p>
1680 <div class="paragraph"><p>This option can only be used for one-shot imports as <em>git svn</em>
1681 will not be able to fetch again without metadata. Additionally,
1682 if you lose your .git/svn/<strong>*/.rev_map.</strong> files, <em>git svn</em> will not
1683 be able to rebuild them.</p></div>
1684 <div class="paragraph"><p>The <em>git svn log</em> command will not work on repositories using
1685 this, either. Using this conflicts with the <em>useSvmProps</em>
1686 option for (hopefully) obvious reasons.</p></div>
1687 <div class="paragraph"><p>This option is NOT recommended as it makes it difficult to track down
1688 old references to SVN revision numbers in existing documentation, bug
1689 reports and archives. If you plan to eventually migrate from SVN to git
1690 and are certain about dropping SVN history, consider
1691 <a href="git-filter-branch.html">git-filter-branch(1)</a> instead. filter-branch also allows
1692 reformatting of metadata for ease-of-reading and rewriting authorship
1693 info for non-"svn.authorsFile" users.</p></div>
1694 </dd>
1695 <dt class="hdlist1">
1696 svn.useSvmProps
1697 </dt>
1698 <dt class="hdlist1">
1699 svn-remote.&lt;name&gt;.useSvmProps
1700 </dt>
1701 <dd>
1703 This allows <em>git svn</em> to re-map repository URLs and UUIDs from
1704 mirrors created using SVN::Mirror (or svk) for metadata.
1705 </p>
1706 <div class="paragraph"><p>If an SVN revision has a property, "svm:headrev", it is likely
1707 that the revision was created by SVN::Mirror (also used by SVK).
1708 The property contains a repository UUID and a revision. We want
1709 to make it look like we are mirroring the original URL, so
1710 introduce a helper function that returns the original identity
1711 URL and UUID, and use it when generating metadata in commit
1712 messages.</p></div>
1713 </dd>
1714 <dt class="hdlist1">
1715 svn.useSvnsyncProps
1716 </dt>
1717 <dt class="hdlist1">
1718 svn-remote.&lt;name&gt;.useSvnsyncprops
1719 </dt>
1720 <dd>
1722 Similar to the useSvmProps option; this is for users
1723 of the svnsync(1) command distributed with SVN 1.4.x and
1724 later.
1725 </p>
1726 </dd>
1727 <dt class="hdlist1">
1728 svn-remote.&lt;name&gt;.rewriteRoot
1729 </dt>
1730 <dd>
1732 This allows users to create repositories from alternate
1733 URLs. For example, an administrator could run <em>git svn</em> on the
1734 server locally (accessing via file://) but wish to distribute
1735 the repository with a public http:// or svn:// URL in the
1736 metadata so users of it will see the public URL.
1737 </p>
1738 </dd>
1739 <dt class="hdlist1">
1740 svn-remote.&lt;name&gt;.rewriteUUID
1741 </dt>
1742 <dd>
1744 Similar to the useSvmProps option; this is for users who need
1745 to remap the UUID manually. This may be useful in situations
1746 where the original UUID is not available via either useSvmProps
1747 or useSvnsyncProps.
1748 </p>
1749 </dd>
1750 <dt class="hdlist1">
1751 svn-remote.&lt;name&gt;.pushurl
1752 </dt>
1753 <dd>
1755 Similar to git&#8217;s <em>remote.&lt;name&gt;.pushurl</em>, this key is designed
1756 to be used in cases where <em>url</em> points to an SVN repository
1757 via a read-only transport, to provide an alternate read/write
1758 transport. It is assumed that both keys point to the same
1759 repository. Unlike <em>commiturl</em>, <em>pushurl</em> is a base path. If
1760 either <em>commiturl</em> or <em>pushurl</em> could be used, <em>commiturl</em>
1761 takes precedence.
1762 </p>
1763 </dd>
1764 <dt class="hdlist1">
1765 svn.brokenSymlinkWorkaround
1766 </dt>
1767 <dd>
1769 This disables potentially expensive checks to workaround
1770 broken symlinks checked into SVN by broken clients. Set this
1771 option to "false" if you track a SVN repository with many
1772 empty blobs that are not symlinks. This option may be changed
1773 while <em>git svn</em> is running and take effect on the next
1774 revision fetched. If unset, <em>git svn</em> assumes this option to
1775 be "true".
1776 </p>
1777 </dd>
1778 <dt class="hdlist1">
1779 svn.pathnameencoding
1780 </dt>
1781 <dd>
1783 This instructs git svn to recode pathnames to a given encoding.
1784 It can be used by windows users and by those who work in non-utf8
1785 locales to avoid corrupted file names with non-ASCII characters.
1786 Valid encodings are the ones supported by Perl&#8217;s Encode module.
1787 </p>
1788 </dd>
1789 <dt class="hdlist1">
1790 svn-remote.&lt;name&gt;.automkdirs
1791 </dt>
1792 <dd>
1794 Normally, the "git svn clone" and "git svn rebase" commands
1795 attempt to recreate empty directories that are in the
1796 Subversion repository. If this option is set to "false", then
1797 empty directories will only be created if the "git svn mkdirs"
1798 command is run explicitly. If unset, <em>git svn</em> assumes this
1799 option to be "true".
1800 </p>
1801 </dd>
1802 </dl></div>
1803 <div class="paragraph"><p>Since the noMetadata, rewriteRoot, rewriteUUID, useSvnsyncProps and useSvmProps
1804 options all affect the metadata generated and used by <em>git svn</em>; they
1805 <strong>must</strong> be set in the configuration file before any history is imported
1806 and these settings should never be changed once they are set.</p></div>
1807 <div class="paragraph"><p>Additionally, only one of these options can be used per svn-remote
1808 section because they affect the <em>git-svn-id:</em> metadata line, except
1809 for rewriteRoot and rewriteUUID which can be used together.</p></div>
1810 </div>
1811 <h2 id="_basic_examples">BASIC EXAMPLES</h2>
1812 <div class="sectionbody">
1813 <div class="paragraph"><p>Tracking and contributing to the trunk of a Subversion-managed project:</p></div>
1814 <div class="listingblock">
1815 <div class="content">
1816 <pre><tt># Clone a repo (like git clone):
1817 git svn clone http://svn.example.com/project/trunk
1818 # Enter the newly cloned directory:
1819 cd trunk
1820 # You should be on master branch, double-check with 'git branch'
1821 git branch
1822 # Do some work and commit locally to git:
1823 git commit ...
1824 # Something is committed to SVN, rebase your local changes against the
1825 # latest changes in SVN:
1826 git svn rebase
1827 # Now commit your changes (that were committed previously using git) to SVN,
1828 # as well as automatically updating your working HEAD:
1829 git svn dcommit
1830 # Append svn:ignore settings to the default git exclude file:
1831 git svn show-ignore &gt;&gt; .git/info/exclude</tt></pre>
1832 </div></div>
1833 <div class="paragraph"><p>Tracking and contributing to an entire Subversion-managed project
1834 (complete with a trunk, tags and branches):</p></div>
1835 <div class="listingblock">
1836 <div class="content">
1837 <pre><tt># Clone a repo (like git clone):
1838 git svn clone http://svn.example.com/project -T trunk -b branches -t tags
1839 # View all branches and tags you have cloned:
1840 git branch -r
1841 # Create a new branch in SVN
1842 git svn branch waldo
1843 # Reset your master to trunk (or any other branch, replacing 'trunk'
1844 # with the appropriate name):
1845 git reset --hard remotes/trunk
1846 # You may only dcommit to one branch/tag/trunk at a time. The usage
1847 # of dcommit/rebase/show-ignore should be the same as above.</tt></pre>
1848 </div></div>
1849 <div class="paragraph"><p>The initial <em>git svn clone</em> can be quite time-consuming
1850 (especially for large Subversion repositories). If multiple
1851 people (or one person with multiple machines) want to use
1852 <em>git svn</em> to interact with the same Subversion repository, you can
1853 do the initial <em>git svn clone</em> to a repository on a server and
1854 have each person clone that repository with <em>git clone</em>:</p></div>
1855 <div class="listingblock">
1856 <div class="content">
1857 <pre><tt># Do the initial import on a server
1858 ssh server "cd /pub &amp;&amp; git svn clone http://svn.example.com/project
1859 # Clone locally - make sure the refs/remotes/ space matches the server
1860 mkdir project
1861 cd project
1862 git init
1863 git remote add origin server:/pub/project
1864 git config --replace-all remote.origin.fetch '+refs/remotes/*:refs/remotes/*'
1865 git fetch
1866 # Prevent fetch/pull from remote git server in the future,
1867 # we only want to use git svn for future updates
1868 git config --remove-section remote.origin
1869 # Create a local branch from one of the branches just fetched
1870 git checkout -b master FETCH_HEAD
1871 # Initialize 'git svn' locally (be sure to use the same URL and -T/-b/-t options as were used on server)
1872 git svn init http://svn.example.com/project
1873 # Pull the latest changes from Subversion
1874 git svn rebase</tt></pre>
1875 </div></div>
1876 </div>
1877 <h2 id="_rebase_vs_pull_merge">REBASE VS. PULL/MERGE</h2>
1878 <div class="sectionbody">
1879 <div class="paragraph"><p>Originally, <em>git svn</em> recommended that the <em>remotes/git-svn</em> branch be
1880 pulled or merged from. This is because the author favored
1881 <tt>git svn set-tree B</tt> to commit a single head rather than the
1882 <tt>git svn set-tree A..B</tt> notation to commit multiple commits.</p></div>
1883 <div class="paragraph"><p>If you use <tt>git svn set-tree A..B</tt> to commit several diffs and you do
1884 not have the latest remotes/git-svn merged into my-branch, you should
1885 use <tt>git svn rebase</tt> to update your work branch instead of <tt>git pull</tt> or
1886 <tt>git merge</tt>. <tt>pull</tt>/<tt>merge</tt> can cause non-linear history to be flattened
1887 when committing into SVN, which can lead to merge commits reversing
1888 previous commits in SVN.</p></div>
1889 </div>
1890 <h2 id="_merge_tracking">MERGE TRACKING</h2>
1891 <div class="sectionbody">
1892 <div class="paragraph"><p>While <em>git svn</em> can track
1893 copy history (including branches and tags) for repositories adopting a
1894 standard layout, it cannot yet represent merge history that happened
1895 inside git back upstream to SVN users. Therefore it is advised that
1896 users keep history as linear as possible inside git to ease
1897 compatibility with SVN (see the CAVEATS section below).</p></div>
1898 </div>
1899 <h2 id="_caveats">CAVEATS</h2>
1900 <div class="sectionbody">
1901 <div class="paragraph"><p>For the sake of simplicity and interoperating with Subversion,
1902 it is recommended that all <em>git svn</em> users clone, fetch and dcommit
1903 directly from the SVN server, and avoid all <em>git clone</em>/<em>pull</em>/<em>merge</em>/<em>push</em>
1904 operations between git repositories and branches. The recommended
1905 method of exchanging code between git branches and users is
1906 <em>git format-patch</em> and <em>git am</em>, or just 'dcommit&#8217;ing to the SVN repository.</p></div>
1907 <div class="paragraph"><p>Running <em>git merge</em> or <em>git pull</em> is NOT recommended on a branch you
1908 plan to <em>dcommit</em> from because Subversion users cannot see any
1909 merges you&#8217;ve made. Furthermore, if you merge or pull from a git branch
1910 that is a mirror of an SVN branch, <em>dcommit</em> may commit to the wrong
1911 branch.</p></div>
1912 <div class="paragraph"><p>If you do merge, note the following rule: <em>git svn dcommit</em> will
1913 attempt to commit on top of the SVN commit named in</p></div>
1914 <div class="listingblock">
1915 <div class="content">
1916 <pre><tt>git log --grep=^git-svn-id: --first-parent -1</tt></pre>
1917 </div></div>
1918 <div class="paragraph"><p>You <em>must</em> therefore ensure that the most recent commit of the branch
1919 you want to dcommit to is the <em>first</em> parent of the merge. Chaos will
1920 ensue otherwise, especially if the first parent is an older commit on
1921 the same SVN branch.</p></div>
1922 <div class="paragraph"><p><em>git clone</em> does not clone branches under the refs/remotes/ hierarchy or
1923 any <em>git svn</em> metadata, or config. So repositories created and managed with
1924 using <em>git svn</em> should use <em>rsync</em> for cloning, if cloning is to be done
1925 at all.</p></div>
1926 <div class="paragraph"><p>Since <em>dcommit</em> uses rebase internally, any git branches you <em>git push</em> to
1927 before <em>dcommit</em> on will require forcing an overwrite of the existing ref
1928 on the remote repository. This is generally considered bad practice,
1929 see the <a href="git-push.html">git-push(1)</a> documentation for details.</p></div>
1930 <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
1931 already dcommitted. It is considered bad practice to --amend commits
1932 you&#8217;ve already pushed to a remote repository for other users, and
1933 dcommit with SVN is analogous to that.</p></div>
1934 <div class="paragraph"><p>When using multiple --branches or --tags, <em>git svn</em> does not automatically
1935 handle name collisions (for example, if two branches from different paths have
1936 the same name, or if a branch and a tag have the same name). In these cases,
1937 use <em>init</em> to set up your git repository then, before your first <em>fetch</em>, edit
1938 the .git/config file so that the branches and tags are associated with
1939 different name spaces. For example:</p></div>
1940 <div class="literalblock">
1941 <div class="content">
1942 <pre><tt>branches = stable/*:refs/remotes/svn/stable/*
1943 branches = debug/*:refs/remotes/svn/debug/*</tt></pre>
1944 </div></div>
1945 </div>
1946 <h2 id="_bugs">BUGS</h2>
1947 <div class="sectionbody">
1948 <div class="paragraph"><p>We ignore all SVN properties except svn:executable. Any unhandled
1949 properties are logged to $GIT_DIR/svn/&lt;refname&gt;/unhandled.log</p></div>
1950 <div class="paragraph"><p>Renamed and copied directories are not detected by git and hence not
1951 tracked when committing to SVN. I do not plan on adding support for
1952 this as it&#8217;s quite difficult and time-consuming to get working for all
1953 the possible corner cases (git doesn&#8217;t do it, either). Committing
1954 renamed and copied files is fully supported if they&#8217;re similar enough
1955 for git to detect them.</p></div>
1956 </div>
1957 <h2 id="_configuration">CONFIGURATION</h2>
1958 <div class="sectionbody">
1959 <div class="paragraph"><p><em>git svn</em> stores [svn-remote] configuration information in the
1960 repository .git/config file. It is similar the core git
1961 [remote] sections except <em>fetch</em> keys do not accept glob
1962 arguments; but they are instead handled by the <em>branches</em>
1963 and <em>tags</em> keys. Since some SVN repositories are oddly
1964 configured with multiple projects glob expansions such those
1965 listed below are allowed:</p></div>
1966 <div class="listingblock">
1967 <div class="content">
1968 <pre><tt>[svn-remote "project-a"]
1969 url = http://server.org/svn
1970 fetch = trunk/project-a:refs/remotes/project-a/trunk
1971 branches = branches/*/project-a:refs/remotes/project-a/branches/*
1972 tags = tags/*/project-a:refs/remotes/project-a/tags/*</tt></pre>
1973 </div></div>
1974 <div class="paragraph"><p>Keep in mind that the <em>*</em> (asterisk) wildcard of the local ref
1975 (right of the <em>:</em>) <strong>must</strong> be the farthest right path component;
1976 however the remote wildcard may be anywhere as long as it&#8217;s an
1977 independent path component (surrounded by <em>/</em> or EOL). This
1978 type of configuration is not automatically created by <em>init</em> and
1979 should be manually entered with a text-editor or using <em>git config</em>.</p></div>
1980 <div class="paragraph"><p>It is also possible to fetch a subset of branches or tags by using a
1981 comma-separated list of names within braces. For example:</p></div>
1982 <div class="listingblock">
1983 <div class="content">
1984 <pre><tt>[svn-remote "huge-project"]
1985 url = http://server.org/svn
1986 fetch = trunk/src:refs/remotes/trunk
1987 branches = branches/{red,green}/src:refs/remotes/branches/*
1988 tags = tags/{1.0,2.0}/src:refs/remotes/tags/*</tt></pre>
1989 </div></div>
1990 <div class="paragraph"><p>Note that git-svn keeps track of the highest revision in which a branch
1991 or tag has appeared. If the subset of branches or tags is changed after
1992 fetching, then .git/svn/.metadata must be manually edited to remove (or
1993 reset) branches-maxRev and/or tags-maxRev as appropriate.</p></div>
1994 </div>
1995 <h2 id="_see_also">SEE ALSO</h2>
1996 <div class="sectionbody">
1997 <div class="paragraph"><p><a href="git-rebase.html">git-rebase(1)</a></p></div>
1998 </div>
1999 <h2 id="_git">GIT</h2>
2000 <div class="sectionbody">
2001 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
2002 </div>
2003 </div>
2004 <div id="footnotes"><hr /></div>
2005 <div id="footer">
2006 <div id="footer-text">
2007 Last updated 2011-10-16 13:41:53 PDT
2008 </div>
2009 </div>
2010 </body>
2011 </html>