Autogenerated HTML docs for v2.42.0-296-g493f46
[git-htmldocs.git] / git-svn.html
blob26baae2bd61b9f47bea8fae3b46f13fc242fa062
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
5 <head>
6 <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
7 <meta name="generator" content="AsciiDoc 10.2.0" />
8 <title>git-svn(1)</title>
9 <style type="text/css">
10 /* Shared CSS for AsciiDoc xhtml11 and html5 backends */
12 /* Default font. */
13 body {
14 font-family: Georgia,serif;
17 /* Title font. */
18 h1, h2, h3, h4, h5, h6,
19 div.title, caption.title,
20 thead, p.table.header,
21 #toctitle,
22 #author, #revnumber, #revdate, #revremark,
23 #footer {
24 font-family: Arial,Helvetica,sans-serif;
27 body {
28 margin: 1em 5% 1em 5%;
31 a {
32 color: blue;
33 text-decoration: underline;
35 a:visited {
36 color: fuchsia;
39 em {
40 font-style: italic;
41 color: navy;
44 strong {
45 font-weight: bold;
46 color: #083194;
49 h1, h2, h3, h4, h5, h6 {
50 color: #527bbd;
51 margin-top: 1.2em;
52 margin-bottom: 0.5em;
53 line-height: 1.3;
56 h1, h2, h3 {
57 border-bottom: 2px solid silver;
59 h2 {
60 padding-top: 0.5em;
62 h3 {
63 float: left;
65 h3 + * {
66 clear: left;
68 h5 {
69 font-size: 1.0em;
72 div.sectionbody {
73 margin-left: 0;
76 hr {
77 border: 1px solid silver;
80 p {
81 margin-top: 0.5em;
82 margin-bottom: 0.5em;
85 ul, ol, li > p {
86 margin-top: 0;
88 ul > li { color: #aaa; }
89 ul > li > * { color: black; }
91 .monospaced, code, pre {
92 font-family: "Courier New", Courier, monospace;
93 font-size: inherit;
94 color: navy;
95 padding: 0;
96 margin: 0;
98 pre {
99 white-space: pre-wrap;
102 #author {
103 color: #527bbd;
104 font-weight: bold;
105 font-size: 1.1em;
107 #email {
109 #revnumber, #revdate, #revremark {
112 #footer {
113 font-size: small;
114 border-top: 2px solid silver;
115 padding-top: 0.5em;
116 margin-top: 4.0em;
118 #footer-text {
119 float: left;
120 padding-bottom: 0.5em;
122 #footer-badges {
123 float: right;
124 padding-bottom: 0.5em;
127 #preamble {
128 margin-top: 1.5em;
129 margin-bottom: 1.5em;
131 div.imageblock, div.exampleblock, div.verseblock,
132 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
133 div.admonitionblock {
134 margin-top: 1.0em;
135 margin-bottom: 1.5em;
137 div.admonitionblock {
138 margin-top: 2.0em;
139 margin-bottom: 2.0em;
140 margin-right: 10%;
141 color: #606060;
144 div.content { /* Block element content. */
145 padding: 0;
148 /* Block element titles. */
149 div.title, caption.title {
150 color: #527bbd;
151 font-weight: bold;
152 text-align: left;
153 margin-top: 1.0em;
154 margin-bottom: 0.5em;
156 div.title + * {
157 margin-top: 0;
160 td div.title:first-child {
161 margin-top: 0.0em;
163 div.content div.title:first-child {
164 margin-top: 0.0em;
166 div.content + div.title {
167 margin-top: 0.0em;
170 div.sidebarblock > div.content {
171 background: #ffffee;
172 border: 1px solid #dddddd;
173 border-left: 4px solid #f0f0f0;
174 padding: 0.5em;
177 div.listingblock > div.content {
178 border: 1px solid #dddddd;
179 border-left: 5px solid #f0f0f0;
180 background: #f8f8f8;
181 padding: 0.5em;
184 div.quoteblock, div.verseblock {
185 padding-left: 1.0em;
186 margin-left: 1.0em;
187 margin-right: 10%;
188 border-left: 5px solid #f0f0f0;
189 color: #888;
192 div.quoteblock > div.attribution {
193 padding-top: 0.5em;
194 text-align: right;
197 div.verseblock > pre.content {
198 font-family: inherit;
199 font-size: inherit;
201 div.verseblock > div.attribution {
202 padding-top: 0.75em;
203 text-align: left;
205 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
206 div.verseblock + div.attribution {
207 text-align: left;
210 div.admonitionblock .icon {
211 vertical-align: top;
212 font-size: 1.1em;
213 font-weight: bold;
214 text-decoration: underline;
215 color: #527bbd;
216 padding-right: 0.5em;
218 div.admonitionblock td.content {
219 padding-left: 0.5em;
220 border-left: 3px solid #dddddd;
223 div.exampleblock > div.content {
224 border-left: 3px solid #dddddd;
225 padding-left: 0.5em;
228 div.imageblock div.content { padding-left: 0; }
229 span.image img { border-style: none; vertical-align: text-bottom; }
230 a.image:visited { color: white; }
232 dl {
233 margin-top: 0.8em;
234 margin-bottom: 0.8em;
236 dt {
237 margin-top: 0.5em;
238 margin-bottom: 0;
239 font-style: normal;
240 color: navy;
242 dd > *:first-child {
243 margin-top: 0.1em;
246 ul, ol {
247 list-style-position: outside;
249 ol.arabic {
250 list-style-type: decimal;
252 ol.loweralpha {
253 list-style-type: lower-alpha;
255 ol.upperalpha {
256 list-style-type: upper-alpha;
258 ol.lowerroman {
259 list-style-type: lower-roman;
261 ol.upperroman {
262 list-style-type: upper-roman;
265 div.compact ul, div.compact ol,
266 div.compact p, div.compact p,
267 div.compact div, div.compact div {
268 margin-top: 0.1em;
269 margin-bottom: 0.1em;
272 tfoot {
273 font-weight: bold;
275 td > div.verse {
276 white-space: pre;
279 div.hdlist {
280 margin-top: 0.8em;
281 margin-bottom: 0.8em;
283 div.hdlist tr {
284 padding-bottom: 15px;
286 dt.hdlist1.strong, td.hdlist1.strong {
287 font-weight: bold;
289 td.hdlist1 {
290 vertical-align: top;
291 font-style: normal;
292 padding-right: 0.8em;
293 color: navy;
295 td.hdlist2 {
296 vertical-align: top;
298 div.hdlist.compact tr {
299 margin: 0;
300 padding-bottom: 0;
303 .comment {
304 background: yellow;
307 .footnote, .footnoteref {
308 font-size: 0.8em;
311 span.footnote, span.footnoteref {
312 vertical-align: super;
315 #footnotes {
316 margin: 20px 0 20px 0;
317 padding: 7px 0 0 0;
320 #footnotes div.footnote {
321 margin: 0 0 5px 0;
324 #footnotes hr {
325 border: none;
326 border-top: 1px solid silver;
327 height: 1px;
328 text-align: left;
329 margin-left: 0;
330 width: 20%;
331 min-width: 100px;
334 div.colist td {
335 padding-right: 0.5em;
336 padding-bottom: 0.3em;
337 vertical-align: top;
339 div.colist td img {
340 margin-top: 0.3em;
343 @media print {
344 #footer-badges { display: none; }
347 #toc {
348 margin-bottom: 2.5em;
351 #toctitle {
352 color: #527bbd;
353 font-size: 1.1em;
354 font-weight: bold;
355 margin-top: 1.0em;
356 margin-bottom: 0.1em;
359 div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
360 margin-top: 0;
361 margin-bottom: 0;
363 div.toclevel2 {
364 margin-left: 2em;
365 font-size: 0.9em;
367 div.toclevel3 {
368 margin-left: 4em;
369 font-size: 0.9em;
371 div.toclevel4 {
372 margin-left: 6em;
373 font-size: 0.9em;
376 span.aqua { color: aqua; }
377 span.black { color: black; }
378 span.blue { color: blue; }
379 span.fuchsia { color: fuchsia; }
380 span.gray { color: gray; }
381 span.green { color: green; }
382 span.lime { color: lime; }
383 span.maroon { color: maroon; }
384 span.navy { color: navy; }
385 span.olive { color: olive; }
386 span.purple { color: purple; }
387 span.red { color: red; }
388 span.silver { color: silver; }
389 span.teal { color: teal; }
390 span.white { color: white; }
391 span.yellow { color: yellow; }
393 span.aqua-background { background: aqua; }
394 span.black-background { background: black; }
395 span.blue-background { background: blue; }
396 span.fuchsia-background { background: fuchsia; }
397 span.gray-background { background: gray; }
398 span.green-background { background: green; }
399 span.lime-background { background: lime; }
400 span.maroon-background { background: maroon; }
401 span.navy-background { background: navy; }
402 span.olive-background { background: olive; }
403 span.purple-background { background: purple; }
404 span.red-background { background: red; }
405 span.silver-background { background: silver; }
406 span.teal-background { background: teal; }
407 span.white-background { background: white; }
408 span.yellow-background { background: yellow; }
410 span.big { font-size: 2em; }
411 span.small { font-size: 0.6em; }
413 span.underline { text-decoration: underline; }
414 span.overline { text-decoration: overline; }
415 span.line-through { text-decoration: line-through; }
417 div.unbreakable { page-break-inside: avoid; }
421 * xhtml11 specific
423 * */
425 div.tableblock {
426 margin-top: 1.0em;
427 margin-bottom: 1.5em;
429 div.tableblock > table {
430 border: 3px solid #527bbd;
432 thead, p.table.header {
433 font-weight: bold;
434 color: #527bbd;
436 p.table {
437 margin-top: 0;
439 /* Because the table frame attribute is overridden by CSS in most browsers. */
440 div.tableblock > table[frame="void"] {
441 border-style: none;
443 div.tableblock > table[frame="hsides"] {
444 border-left-style: none;
445 border-right-style: none;
447 div.tableblock > table[frame="vsides"] {
448 border-top-style: none;
449 border-bottom-style: none;
454 * html5 specific
456 * */
458 table.tableblock {
459 margin-top: 1.0em;
460 margin-bottom: 1.5em;
462 thead, p.tableblock.header {
463 font-weight: bold;
464 color: #527bbd;
466 p.tableblock {
467 margin-top: 0;
469 table.tableblock {
470 border-width: 3px;
471 border-spacing: 0px;
472 border-style: solid;
473 border-color: #527bbd;
474 border-collapse: collapse;
476 th.tableblock, td.tableblock {
477 border-width: 1px;
478 padding: 4px;
479 border-style: solid;
480 border-color: #527bbd;
483 table.tableblock.frame-topbot {
484 border-left-style: hidden;
485 border-right-style: hidden;
487 table.tableblock.frame-sides {
488 border-top-style: hidden;
489 border-bottom-style: hidden;
491 table.tableblock.frame-none {
492 border-style: hidden;
495 th.tableblock.halign-left, td.tableblock.halign-left {
496 text-align: left;
498 th.tableblock.halign-center, td.tableblock.halign-center {
499 text-align: center;
501 th.tableblock.halign-right, td.tableblock.halign-right {
502 text-align: right;
505 th.tableblock.valign-top, td.tableblock.valign-top {
506 vertical-align: top;
508 th.tableblock.valign-middle, td.tableblock.valign-middle {
509 vertical-align: middle;
511 th.tableblock.valign-bottom, td.tableblock.valign-bottom {
512 vertical-align: bottom;
517 * manpage specific
519 * */
521 body.manpage h1 {
522 padding-top: 0.5em;
523 padding-bottom: 0.5em;
524 border-top: 2px solid silver;
525 border-bottom: 2px solid silver;
527 body.manpage h2 {
528 border-style: none;
530 body.manpage div.sectionbody {
531 margin-left: 3em;
534 @media print {
535 body.manpage div#toc { display: none; }
539 </style>
540 <script type="text/javascript">
541 /*<![CDATA[*/
542 var asciidoc = { // Namespace.
544 /////////////////////////////////////////////////////////////////////
545 // Table Of Contents generator
546 /////////////////////////////////////////////////////////////////////
548 /* Author: Mihai Bazon, September 2002
549 * http://students.infoiasi.ro/~mishoo
551 * Table Of Content generator
552 * Version: 0.4
554 * Feel free to use this script under the terms of the GNU General Public
555 * License, as long as you do not remove or alter this notice.
558 /* modified by Troy D. Hanson, September 2006. License: GPL */
559 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
561 // toclevels = 1..4.
562 toc: function (toclevels) {
564 function getText(el) {
565 var text = "";
566 for (var i = el.firstChild; i != null; i = i.nextSibling) {
567 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
568 text += i.data;
569 else if (i.firstChild != null)
570 text += getText(i);
572 return text;
575 function TocEntry(el, text, toclevel) {
576 this.element = el;
577 this.text = text;
578 this.toclevel = toclevel;
581 function tocEntries(el, toclevels) {
582 var result = new Array;
583 var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
584 // Function that scans the DOM tree for header elements (the DOM2
585 // nodeIterator API would be a better technique but not supported by all
586 // browsers).
587 var iterate = function (el) {
588 for (var i = el.firstChild; i != null; i = i.nextSibling) {
589 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
590 var mo = re.exec(i.tagName);
591 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
592 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
594 iterate(i);
598 iterate(el);
599 return result;
602 var toc = document.getElementById("toc");
603 if (!toc) {
604 return;
607 // Delete existing TOC entries in case we're reloading the TOC.
608 var tocEntriesToRemove = [];
609 var i;
610 for (i = 0; i < toc.childNodes.length; i++) {
611 var entry = toc.childNodes[i];
612 if (entry.nodeName.toLowerCase() == 'div'
613 && entry.getAttribute("class")
614 && entry.getAttribute("class").match(/^toclevel/))
615 tocEntriesToRemove.push(entry);
617 for (i = 0; i < tocEntriesToRemove.length; i++) {
618 toc.removeChild(tocEntriesToRemove[i]);
621 // Rebuild TOC entries.
622 var entries = tocEntries(document.getElementById("content"), toclevels);
623 for (var i = 0; i < entries.length; ++i) {
624 var entry = entries[i];
625 if (entry.element.id == "")
626 entry.element.id = "_toc_" + i;
627 var a = document.createElement("a");
628 a.href = "#" + entry.element.id;
629 a.appendChild(document.createTextNode(entry.text));
630 var div = document.createElement("div");
631 div.appendChild(a);
632 div.className = "toclevel" + entry.toclevel;
633 toc.appendChild(div);
635 if (entries.length == 0)
636 toc.parentNode.removeChild(toc);
640 /////////////////////////////////////////////////////////////////////
641 // Footnotes generator
642 /////////////////////////////////////////////////////////////////////
644 /* Based on footnote generation code from:
645 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
648 footnotes: function () {
649 // Delete existing footnote entries in case we're reloading the footnodes.
650 var i;
651 var noteholder = document.getElementById("footnotes");
652 if (!noteholder) {
653 return;
655 var entriesToRemove = [];
656 for (i = 0; i < noteholder.childNodes.length; i++) {
657 var entry = noteholder.childNodes[i];
658 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
659 entriesToRemove.push(entry);
661 for (i = 0; i < entriesToRemove.length; i++) {
662 noteholder.removeChild(entriesToRemove[i]);
665 // Rebuild footnote entries.
666 var cont = document.getElementById("content");
667 var spans = cont.getElementsByTagName("span");
668 var refs = {};
669 var n = 0;
670 for (i=0; i<spans.length; i++) {
671 if (spans[i].className == "footnote") {
672 n++;
673 var note = spans[i].getAttribute("data-note");
674 if (!note) {
675 // Use [\s\S] in place of . so multi-line matches work.
676 // Because JavaScript has no s (dotall) regex flag.
677 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
678 spans[i].innerHTML =
679 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
680 "' title='View footnote' class='footnote'>" + n + "</a>]";
681 spans[i].setAttribute("data-note", note);
683 noteholder.innerHTML +=
684 "<div class='footnote' id='_footnote_" + n + "'>" +
685 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
686 n + "</a>. " + note + "</div>";
687 var id =spans[i].getAttribute("id");
688 if (id != null) refs["#"+id] = n;
691 if (n == 0)
692 noteholder.parentNode.removeChild(noteholder);
693 else {
694 // Process footnoterefs.
695 for (i=0; i<spans.length; i++) {
696 if (spans[i].className == "footnoteref") {
697 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
698 href = href.match(/#.*/)[0]; // Because IE return full URL.
699 n = refs[href];
700 spans[i].innerHTML =
701 "[<a href='#_footnote_" + n +
702 "' title='View footnote' class='footnote'>" + n + "</a>]";
708 install: function(toclevels) {
709 var timerId;
711 function reinstall() {
712 asciidoc.footnotes();
713 if (toclevels) {
714 asciidoc.toc(toclevels);
718 function reinstallAndRemoveTimer() {
719 clearInterval(timerId);
720 reinstall();
723 timerId = setInterval(reinstall, 500);
724 if (document.addEventListener)
725 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
726 else
727 window.onload = reinstallAndRemoveTimer;
731 asciidoc.install();
732 /*]]>*/
733 </script>
734 </head>
735 <body class="manpage">
736 <div id="header">
737 <h1>
738 git-svn(1) Manual Page
739 </h1>
740 <h2>NAME</h2>
741 <div class="sectionbody">
742 <p>git-svn -
743 Bidirectional operation between a Subversion repository and Git
744 </p>
745 </div>
746 </div>
747 <div id="content">
748 <div class="sect1">
749 <h2 id="_synopsis">SYNOPSIS</h2>
750 <div class="sectionbody">
751 <div class="verseblock">
752 <pre class="content"><em>git svn</em> &lt;command&gt; [&lt;options&gt;] [&lt;arguments&gt;]</pre>
753 <div class="attribution">
754 </div></div>
755 </div>
756 </div>
757 <div class="sect1">
758 <h2 id="_description">DESCRIPTION</h2>
759 <div class="sectionbody">
760 <div class="paragraph"><p><em>git svn</em> is a simple conduit for changesets between Subversion and Git.
761 It provides a bidirectional flow of changes between a Subversion and a Git
762 repository.</p></div>
763 <div class="paragraph"><p><em>git svn</em> can track a standard Subversion repository,
764 following the common "trunk/branches/tags" layout, with the --stdlayout option.
765 It can also follow branches and tags in any layout with the -T/-t/-b options
766 (see options to <em>init</em> below, and also the <em>clone</em> command).</p></div>
767 <div class="paragraph"><p>Once tracking a Subversion repository (with any of the above methods), the Git
768 repository can be updated from Subversion by the <em>fetch</em> command and
769 Subversion updated from Git by the <em>dcommit</em> command.</p></div>
770 </div>
771 </div>
772 <div class="sect1">
773 <h2 id="_commands">COMMANDS</h2>
774 <div class="sectionbody">
775 <div class="dlist"><dl>
776 <dt class="hdlist1">
777 <em>init</em>
778 </dt>
779 <dd>
781 Initializes an empty Git repository with additional
782 metadata directories for <em>git svn</em>. The Subversion URL
783 may be specified as a command-line argument, or as full
784 URL arguments to -T/-t/-b. Optionally, the target
785 directory to operate on can be specified as a second
786 argument. Normally this command initializes the current
787 directory.
788 </p>
789 <div class="dlist"><dl>
790 <dt class="hdlist1">
791 -T&lt;trunk_subdir&gt;
792 </dt>
793 <dt class="hdlist1">
794 --trunk=&lt;trunk_subdir&gt;
795 </dt>
796 <dt class="hdlist1">
797 -t&lt;tags_subdir&gt;
798 </dt>
799 <dt class="hdlist1">
800 --tags=&lt;tags_subdir&gt;
801 </dt>
802 <dt class="hdlist1">
803 -b&lt;branches_subdir&gt;
804 </dt>
805 <dt class="hdlist1">
806 --branches=&lt;branches_subdir&gt;
807 </dt>
808 <dt class="hdlist1">
810 </dt>
811 <dt class="hdlist1">
812 --stdlayout
813 </dt>
814 <dd>
816 These are optional command-line options for init. Each of
817 these flags can point to a relative repository path
818 (--tags=project/tags) or a full url
819 (--tags=https://foo.org/project/tags).
820 You can specify more than one --tags and/or --branches options, in case
821 your Subversion repository places tags or branches under multiple paths.
822 The option --stdlayout is
823 a shorthand way of setting trunk,tags,branches as the relative paths,
824 which is the Subversion default. If any of the other options are given
825 as well, they take precedence.
826 </p>
827 </dd>
828 <dt class="hdlist1">
829 --no-metadata
830 </dt>
831 <dd>
833 Set the <em>noMetadata</em> option in the [svn-remote] config.
834 This option is not recommended, please read the <em>svn.noMetadata</em>
835 section of this manpage before using this option.
836 </p>
837 </dd>
838 <dt class="hdlist1">
839 --use-svm-props
840 </dt>
841 <dd>
843 Set the <em>useSvmProps</em> option in the [svn-remote] config.
844 </p>
845 </dd>
846 <dt class="hdlist1">
847 --use-svnsync-props
848 </dt>
849 <dd>
851 Set the <em>useSvnsyncProps</em> option in the [svn-remote] config.
852 </p>
853 </dd>
854 <dt class="hdlist1">
855 --rewrite-root=&lt;URL&gt;
856 </dt>
857 <dd>
859 Set the <em>rewriteRoot</em> option in the [svn-remote] config.
860 </p>
861 </dd>
862 <dt class="hdlist1">
863 --rewrite-uuid=&lt;UUID&gt;
864 </dt>
865 <dd>
867 Set the <em>rewriteUUID</em> option in the [svn-remote] config.
868 </p>
869 </dd>
870 <dt class="hdlist1">
871 --username=&lt;user&gt;
872 </dt>
873 <dd>
875 For transports that SVN handles authentication for (http,
876 https, and plain svn), specify the username. For other
877 transports (e.g. <code>svn+ssh://</code>), you must include the username in
878 the URL, e.g. <code>svn+ssh://foo@svn.bar.com/project</code>
879 </p>
880 </dd>
881 <dt class="hdlist1">
882 --prefix=&lt;prefix&gt;
883 </dt>
884 <dd>
886 This allows one to specify a prefix which is prepended
887 to the names of remotes if trunk/branches/tags are
888 specified. The prefix does not automatically include a
889 trailing slash, so be sure you include one in the
890 argument if that is what you want. If --branches/-b is
891 specified, the prefix must include a trailing slash.
892 Setting a prefix (with a trailing slash) is strongly
893 encouraged in any case, as your SVN-tracking refs will
894 then be located at "refs/remotes/$prefix/<strong>", which is
895 compatible with Git&#8217;s own remote-tracking ref layout
896 (refs/remotes/$remote/</strong>). Setting a prefix is also useful
897 if you wish to track multiple projects that share a common
898 repository.
899 By default, the prefix is set to <em>origin/</em>.
900 </p>
901 <div class="admonitionblock">
902 <table><tr>
903 <td class="icon">
904 <div class="title">Note</div>
905 </td>
906 <td class="content">Before Git v2.0, the default prefix was "" (no prefix). This
907 meant that SVN-tracking refs were put at "refs/remotes/*", which is
908 incompatible with how Git&#8217;s own remote-tracking refs are organized.
909 If you still want the old default, you can get it by passing
910 <code>--prefix ""</code> on the command line (<code>--prefix=""</code> may not work if
911 your Perl&#8217;s Getopt::Long is &lt; v2.37).</td>
912 </tr></table>
913 </div>
914 </dd>
915 <dt class="hdlist1">
916 --ignore-refs=&lt;regex&gt;
917 </dt>
918 <dd>
920 When passed to <em>init</em> or <em>clone</em> this regular expression will
921 be preserved as a config key. See <em>fetch</em> for a description
922 of <code>--ignore-refs</code>.
923 </p>
924 </dd>
925 <dt class="hdlist1">
926 --ignore-paths=&lt;regex&gt;
927 </dt>
928 <dd>
930 When passed to <em>init</em> or <em>clone</em> this regular expression will
931 be preserved as a config key. See <em>fetch</em> for a description
932 of <code>--ignore-paths</code>.
933 </p>
934 </dd>
935 <dt class="hdlist1">
936 --include-paths=&lt;regex&gt;
937 </dt>
938 <dd>
940 When passed to <em>init</em> or <em>clone</em> this regular expression will
941 be preserved as a config key. See <em>fetch</em> for a description
942 of <code>--include-paths</code>.
943 </p>
944 </dd>
945 <dt class="hdlist1">
946 --no-minimize-url
947 </dt>
948 <dd>
950 When tracking multiple directories (using --stdlayout,
951 --branches, or --tags options), git svn will attempt to connect
952 to the root (or highest allowed level) of the Subversion
953 repository. This default allows better tracking of history if
954 entire projects are moved within a repository, but may cause
955 issues on repositories where read access restrictions are in
956 place. Passing <code>--no-minimize-url</code> will allow git svn to
957 accept URLs as-is without attempting to connect to a higher
958 level directory. This option is off by default when only
959 one URL/branch is tracked (it would do little good).
960 </p>
961 </dd>
962 </dl></div>
963 </dd>
964 <dt class="hdlist1">
965 <em>fetch</em>
966 </dt>
967 <dd>
969 Fetch unfetched revisions from the Subversion remote we are
970 tracking. The name of the [svn-remote "&#8230;"] section in the
971 $GIT_DIR/config file may be specified as an optional
972 command-line argument.
973 </p>
974 <div class="paragraph"><p>This automatically updates the rev_map if needed (see
975 <em>$GIT_DIR/svn/**/.rev_map.*</em> in the FILES section below for details).</p></div>
976 <div class="dlist"><dl>
977 <dt class="hdlist1">
978 --localtime
979 </dt>
980 <dd>
982 Store Git commit times in the local time zone instead of UTC. This
983 makes <em>git log</em> (even without --date=local) show the same times
984 that <code>svn log</code> would in the local time zone.
985 </p>
986 <div class="paragraph"><p>This doesn&#8217;t interfere with interoperating with the Subversion
987 repository you cloned from, but if you wish for your local Git
988 repository to be able to interoperate with someone else&#8217;s local Git
989 repository, either don&#8217;t use this option or you should both use it in
990 the same local time zone.</p></div>
991 </dd>
992 <dt class="hdlist1">
993 --parent
994 </dt>
995 <dd>
997 Fetch only from the SVN parent of the current HEAD.
998 </p>
999 </dd>
1000 <dt class="hdlist1">
1001 --ignore-refs=&lt;regex&gt;
1002 </dt>
1003 <dd>
1005 Ignore refs for branches or tags matching the Perl regular
1006 expression. A "negative look-ahead assertion" like
1007 <code>^refs/remotes/origin/(?!tags/wanted-tag|wanted-branch).*$</code>
1008 can be used to allow only certain refs.
1009 </p>
1010 <div class="verseblock">
1011 <pre class="content">config key: svn-remote.&lt;name&gt;.ignore-refs</pre>
1012 <div class="attribution">
1013 </div></div>
1014 <div class="paragraph"><p>If the ignore-refs configuration key is set, and the command-line
1015 option is also given, both regular expressions will be used.</p></div>
1016 </dd>
1017 <dt class="hdlist1">
1018 --ignore-paths=&lt;regex&gt;
1019 </dt>
1020 <dd>
1022 This allows one to specify a Perl regular expression that will
1023 cause skipping of all matching paths from checkout from SVN.
1024 The <code>--ignore-paths</code> option should match for every <em>fetch</em>
1025 (including automatic fetches due to <em>clone</em>, <em>dcommit</em>,
1026 <em>rebase</em>, etc) on a given repository.
1027 </p>
1028 <div class="verseblock">
1029 <pre class="content">config key: svn-remote.&lt;name&gt;.ignore-paths</pre>
1030 <div class="attribution">
1031 </div></div>
1032 <div class="paragraph"><p>If the ignore-paths configuration key is set, and the command-line
1033 option is also given, both regular expressions will be used.</p></div>
1034 <div class="paragraph"><p>Examples:</p></div>
1035 <div class="openblock">
1036 <div class="content">
1037 <div class="dlist"><dl>
1038 <dt class="hdlist1">
1039 Skip "doc*" directory for every fetch
1040 </dt>
1041 <dd>
1042 <div class="listingblock">
1043 <div class="content">
1044 <pre><code>--ignore-paths="^doc"</code></pre>
1045 </div></div>
1046 </dd>
1047 <dt class="hdlist1">
1048 Skip "branches" and "tags" of first level directories
1049 </dt>
1050 <dd>
1051 <div class="listingblock">
1052 <div class="content">
1053 <pre><code>--ignore-paths="^[^/]+/(?:branches|tags)"</code></pre>
1054 </div></div>
1055 </dd>
1056 </dl></div>
1057 </div></div>
1058 </dd>
1059 <dt class="hdlist1">
1060 --include-paths=&lt;regex&gt;
1061 </dt>
1062 <dd>
1064 This allows one to specify a Perl regular expression that will
1065 cause the inclusion of only matching paths from checkout from SVN.
1066 The <code>--include-paths</code> option should match for every <em>fetch</em>
1067 (including automatic fetches due to <em>clone</em>, <em>dcommit</em>,
1068 <em>rebase</em>, etc) on a given repository. <code>--ignore-paths</code> takes
1069 precedence over <code>--include-paths</code>.
1070 </p>
1071 <div class="verseblock">
1072 <pre class="content">config key: svn-remote.&lt;name&gt;.include-paths</pre>
1073 <div class="attribution">
1074 </div></div>
1075 </dd>
1076 <dt class="hdlist1">
1077 --log-window-size=&lt;n&gt;
1078 </dt>
1079 <dd>
1081 Fetch &lt;n&gt; log entries per request when scanning Subversion history.
1082 The default is 100. For very large Subversion repositories, larger
1083 values may be needed for <em>clone</em>/<em>fetch</em> to complete in reasonable
1084 time. But overly large values may lead to higher memory usage and
1085 request timeouts.
1086 </p>
1087 </dd>
1088 </dl></div>
1089 </dd>
1090 <dt class="hdlist1">
1091 <em>clone</em>
1092 </dt>
1093 <dd>
1095 Runs <em>init</em> and <em>fetch</em>. It will automatically create a
1096 directory based on the basename of the URL passed to it;
1097 or if a second argument is passed; it will create a directory
1098 and work within that. It accepts all arguments that the
1099 <em>init</em> and <em>fetch</em> commands accept; with the exception of
1100 <code>--fetch-all</code> and <code>--parent</code>. After a repository is cloned,
1101 the <em>fetch</em> command will be able to update revisions without
1102 affecting the working tree; and the <em>rebase</em> command will be
1103 able to update the working tree with the latest changes.
1104 </p>
1105 <div class="dlist"><dl>
1106 <dt class="hdlist1">
1107 --preserve-empty-dirs
1108 </dt>
1109 <dd>
1111 Create a placeholder file in the local Git repository for each
1112 empty directory fetched from Subversion. This includes directories
1113 that become empty by removing all entries in the Subversion
1114 repository (but not the directory itself). The placeholder files
1115 are also tracked and removed when no longer necessary.
1116 </p>
1117 </dd>
1118 <dt class="hdlist1">
1119 --placeholder-filename=&lt;filename&gt;
1120 </dt>
1121 <dd>
1123 Set the name of placeholder files created by --preserve-empty-dirs.
1124 Default: ".gitignore"
1125 </p>
1126 </dd>
1127 </dl></div>
1128 </dd>
1129 <dt class="hdlist1">
1130 <em>rebase</em>
1131 </dt>
1132 <dd>
1134 This fetches revisions from the SVN parent of the current HEAD
1135 and rebases the current (uncommitted to SVN) work against it.
1136 </p>
1137 <div class="paragraph"><p>This works similarly to <code>svn update</code> or <em>git pull</em> except that
1138 it preserves linear history with <em>git rebase</em> instead of
1139 <em>git merge</em> for ease of dcommitting with <em>git svn</em>.</p></div>
1140 <div class="paragraph"><p>This accepts all options that <em>git svn fetch</em> and <em>git rebase</em>
1141 accept. However, <code>--fetch-all</code> only fetches from the current
1142 [svn-remote], and not all [svn-remote] definitions.</p></div>
1143 <div class="paragraph"><p>Like <em>git rebase</em>; this requires that the working tree be clean
1144 and have no uncommitted changes.</p></div>
1145 <div class="paragraph"><p>This automatically updates the rev_map if needed (see
1146 <em>$GIT_DIR/svn/**/.rev_map.*</em> in the FILES section below for details).</p></div>
1147 <div class="dlist"><dl>
1148 <dt class="hdlist1">
1150 </dt>
1151 <dt class="hdlist1">
1152 --local
1153 </dt>
1154 <dd>
1156 Do not fetch remotely; only run <em>git rebase</em> against the
1157 last fetched commit from the upstream SVN.
1158 </p>
1159 </dd>
1160 </dl></div>
1161 </dd>
1162 <dt class="hdlist1">
1163 <em>dcommit</em>
1164 </dt>
1165 <dd>
1167 Commit each diff from the current branch directly to the SVN
1168 repository, and then rebase or reset (depending on whether or
1169 not there is a diff between SVN and head). This will create
1170 a revision in SVN for each commit in Git.
1171 </p>
1172 <div class="paragraph"><p>When an optional Git branch name (or a Git commit object name)
1173 is specified as an argument, the subcommand works on the specified
1174 branch, not on the current branch.</p></div>
1175 <div class="paragraph"><p>Use of <em>dcommit</em> is preferred to <em>set-tree</em> (below).</p></div>
1176 <div class="dlist"><dl>
1177 <dt class="hdlist1">
1178 --no-rebase
1179 </dt>
1180 <dd>
1182 After committing, do not rebase or reset.
1183 </p>
1184 </dd>
1185 <dt class="hdlist1">
1186 --commit-url &lt;URL&gt;
1187 </dt>
1188 <dd>
1190 Commit to this SVN URL (the full path). This is intended to
1191 allow existing <em>git svn</em> repositories created with one transport
1192 method (e.g. <code>svn://</code> or <code>http://</code> for anonymous read) to be
1193 reused if a user is later given access to an alternate transport
1194 method (e.g. <code>svn+ssh://</code> or <code>https://</code>) for commit.
1195 </p>
1196 <div class="verseblock">
1197 <pre class="content">config key: svn-remote.&lt;name&gt;.commiturl
1198 config key: svn.commiturl (overwrites all svn-remote.&lt;name&gt;.commiturl options)</pre>
1199 <div class="attribution">
1200 </div></div>
1201 <div class="paragraph"><p>Note that the SVN URL of the commiturl config key includes the SVN branch.
1202 If you rather want to set the commit URL for an entire SVN repository use
1203 svn-remote.&lt;name&gt;.pushurl instead.</p></div>
1204 <div class="paragraph"><p>Using this option for any other purpose (don&#8217;t ask) is very strongly
1205 discouraged.</p></div>
1206 </dd>
1207 <dt class="hdlist1">
1208 --mergeinfo=&lt;mergeinfo&gt;
1209 </dt>
1210 <dd>
1212 Add the given merge information during the dcommit
1213 (e.g. <code>--mergeinfo="/branches/foo:1-10"</code>). All svn server versions can
1214 store this information (as a property), and svn clients starting from
1215 version 1.5 can make use of it. To specify merge information from multiple
1216 branches, use a single space character between the branches
1217 (<code>--mergeinfo="/branches/foo:1-10 /branches/bar:3,5-6,8"</code>)
1218 </p>
1219 <div class="verseblock">
1220 <pre class="content">config key: svn.pushmergeinfo</pre>
1221 <div class="attribution">
1222 </div></div>
1223 <div class="paragraph"><p>This option will cause git-svn to attempt to automatically populate the
1224 svn:mergeinfo property in the SVN repository when possible. Currently, this can
1225 only be done when dcommitting non-fast-forward merges where all parents but the
1226 first have already been pushed into SVN.</p></div>
1227 </dd>
1228 <dt class="hdlist1">
1229 --interactive
1230 </dt>
1231 <dd>
1233 Ask the user to confirm that a patch set should actually be sent to SVN.
1234 For each patch, one may answer "yes" (accept this patch), "no" (discard this
1235 patch), "all" (accept all patches), or "quit".
1236 </p>
1237 <div class="paragraph"><p><em>git svn dcommit</em> returns immediately if answer is "no" or "quit", without
1238 committing anything to SVN.</p></div>
1239 </dd>
1240 </dl></div>
1241 </dd>
1242 <dt class="hdlist1">
1243 <em>branch</em>
1244 </dt>
1245 <dd>
1247 Create a branch in the SVN repository.
1248 </p>
1249 <div class="dlist"><dl>
1250 <dt class="hdlist1">
1252 </dt>
1253 <dt class="hdlist1">
1254 --message
1255 </dt>
1256 <dd>
1258 Allows to specify the commit message.
1259 </p>
1260 </dd>
1261 <dt class="hdlist1">
1263 </dt>
1264 <dt class="hdlist1">
1265 --tag
1266 </dt>
1267 <dd>
1269 Create a tag by using the tags_subdir instead of the branches_subdir
1270 specified during git svn init.
1271 </p>
1272 </dd>
1273 <dt class="hdlist1">
1274 -d&lt;path&gt;
1275 </dt>
1276 <dt class="hdlist1">
1277 --destination=&lt;path&gt;
1278 </dt>
1279 <dd>
1281 If more than one --branches (or --tags) option was given to the <em>init</em>
1282 or <em>clone</em> command, you must provide the location of the branch (or
1283 tag) you wish to create in the SVN repository. &lt;path&gt; specifies which
1284 path to use to create the branch or tag and should match the pattern
1285 on the left-hand side of one of the configured branches or tags
1286 refspecs. You can see these refspecs with the commands
1287 </p>
1288 <div class="literalblock">
1289 <div class="content">
1290 <pre><code>git config --get-all svn-remote.&lt;name&gt;.branches
1291 git config --get-all svn-remote.&lt;name&gt;.tags</code></pre>
1292 </div></div>
1293 <div class="paragraph"><p>where &lt;name&gt; is the name of the SVN repository as specified by the -R option to
1294 <em>init</em> (or "svn" by default).</p></div>
1295 </dd>
1296 <dt class="hdlist1">
1297 --username
1298 </dt>
1299 <dd>
1301 Specify the SVN username to perform the commit as. This option overrides
1302 the <em>username</em> configuration property.
1303 </p>
1304 </dd>
1305 <dt class="hdlist1">
1306 --commit-url
1307 </dt>
1308 <dd>
1310 Use the specified URL to connect to the destination Subversion
1311 repository. This is useful in cases where the source SVN
1312 repository is read-only. This option overrides configuration
1313 property <em>commiturl</em>.
1314 </p>
1315 <div class="literalblock">
1316 <div class="content">
1317 <pre><code>git config --get-all svn-remote.&lt;name&gt;.commiturl</code></pre>
1318 </div></div>
1319 </dd>
1320 <dt class="hdlist1">
1321 --parents
1322 </dt>
1323 <dd>
1325 Create parent folders. This parameter is equivalent to the parameter
1326 --parents on svn cp commands and is useful for non-standard repository
1327 layouts.
1328 </p>
1329 </dd>
1330 </dl></div>
1331 </dd>
1332 <dt class="hdlist1">
1333 <em>tag</em>
1334 </dt>
1335 <dd>
1337 Create a tag in the SVN repository. This is a shorthand for
1338 <em>branch -t</em>.
1339 </p>
1340 </dd>
1341 <dt class="hdlist1">
1342 <em>log</em>
1343 </dt>
1344 <dd>
1346 This should make it easy to look up svn log messages when svn
1347 users refer to -r/--revision numbers.
1348 </p>
1349 <div class="paragraph"><p>The following features from &#8216;svn log&#8217; are supported:</p></div>
1350 <div class="openblock">
1351 <div class="content">
1352 <div class="dlist"><dl>
1353 <dt class="hdlist1">
1354 -r &lt;n&gt;[:&lt;n&gt;]
1355 </dt>
1356 <dt class="hdlist1">
1357 --revision=&lt;n&gt;[:&lt;n&gt;]
1358 </dt>
1359 <dd>
1361 is supported, non-numeric args are not:
1362 HEAD, NEXT, BASE, PREV, etc &#8230;
1363 </p>
1364 </dd>
1365 <dt class="hdlist1">
1367 </dt>
1368 <dt class="hdlist1">
1369 --verbose
1370 </dt>
1371 <dd>
1373 it&#8217;s not completely compatible with the --verbose
1374 output in svn log, but reasonably close.
1375 </p>
1376 </dd>
1377 <dt class="hdlist1">
1378 --limit=&lt;n&gt;
1379 </dt>
1380 <dd>
1382 is NOT the same as --max-count, doesn&#8217;t count
1383 merged/excluded commits
1384 </p>
1385 </dd>
1386 <dt class="hdlist1">
1387 --incremental
1388 </dt>
1389 <dd>
1391 supported
1392 </p>
1393 </dd>
1394 </dl></div>
1395 </div></div>
1396 <div class="paragraph"><p>New features:</p></div>
1397 <div class="openblock">
1398 <div class="content">
1399 <div class="dlist"><dl>
1400 <dt class="hdlist1">
1401 --show-commit
1402 </dt>
1403 <dd>
1405 shows the Git commit sha1, as well
1406 </p>
1407 </dd>
1408 <dt class="hdlist1">
1409 --oneline
1410 </dt>
1411 <dd>
1413 our version of --pretty=oneline
1414 </p>
1415 </dd>
1416 </dl></div>
1417 </div></div>
1418 <div class="admonitionblock">
1419 <table><tr>
1420 <td class="icon">
1421 <div class="title">Note</div>
1422 </td>
1423 <td class="content">SVN itself only stores times in UTC and nothing else. The regular svn
1424 client converts the UTC time to the local time (or based on the TZ=
1425 environment). This command has the same behaviour.</td>
1426 </tr></table>
1427 </div>
1428 <div class="paragraph"><p>Any other arguments are passed directly to <em>git log</em></p></div>
1429 </dd>
1430 <dt class="hdlist1">
1431 <em>blame</em>
1432 </dt>
1433 <dd>
1435 Show what revision and author last modified each line of a file. The
1436 output of this mode is format-compatible with the output of
1437 &#8216;svn blame&#8217; by default. Like the SVN blame command,
1438 local uncommitted changes in the working tree are ignored;
1439 the version of the file in the HEAD revision is annotated. Unknown
1440 arguments are passed directly to <em>git blame</em>.
1441 </p>
1442 <div class="dlist"><dl>
1443 <dt class="hdlist1">
1444 --git-format
1445 </dt>
1446 <dd>
1448 Produce output in the same format as <em>git blame</em>, but with
1449 SVN revision numbers instead of Git commit hashes. In this mode,
1450 changes that haven&#8217;t been committed to SVN (including local
1451 working-copy edits) are shown as revision 0.
1452 </p>
1453 </dd>
1454 </dl></div>
1455 </dd>
1456 <dt class="hdlist1">
1457 <em>find-rev</em>
1458 </dt>
1459 <dd>
1461 When given an SVN revision number of the form <em>rN</em>, returns the
1462 corresponding Git commit hash (this can optionally be followed by a
1463 tree-ish to specify which branch should be searched). When given a
1464 tree-ish, returns the corresponding SVN revision number.
1465 </p>
1466 <div class="dlist"><dl>
1467 <dt class="hdlist1">
1469 </dt>
1470 <dt class="hdlist1">
1471 --before
1472 </dt>
1473 <dd>
1475 Don&#8217;t require an exact match if given an SVN revision, instead find
1476 the commit corresponding to the state of the SVN repository (on the
1477 current branch) at the specified revision.
1478 </p>
1479 </dd>
1480 <dt class="hdlist1">
1482 </dt>
1483 <dt class="hdlist1">
1484 --after
1485 </dt>
1486 <dd>
1488 Don&#8217;t require an exact match if given an SVN revision; if there is
1489 not an exact match return the closest match searching forward in the
1490 history.
1491 </p>
1492 </dd>
1493 </dl></div>
1494 </dd>
1495 <dt class="hdlist1">
1496 <em>set-tree</em>
1497 </dt>
1498 <dd>
1500 You should consider using <em>dcommit</em> instead of this command.
1501 Commit specified commit or tree objects to SVN. This relies on
1502 your imported fetch data being up to date. This makes
1503 absolutely no attempts to do patching when committing to SVN, it
1504 simply overwrites files with those specified in the tree or
1505 commit. All merging is assumed to have taken place
1506 independently of <em>git svn</em> functions.
1507 </p>
1508 </dd>
1509 <dt class="hdlist1">
1510 <em>create-ignore</em>
1511 </dt>
1512 <dd>
1514 Recursively finds the svn:ignore property on directories and
1515 creates matching .gitignore files. The resulting files are staged to
1516 be committed, but are not committed. Use -r/--revision to refer to a
1517 specific revision.
1518 </p>
1519 </dd>
1520 <dt class="hdlist1">
1521 <em>show-ignore</em>
1522 </dt>
1523 <dd>
1525 Recursively finds and lists the svn:ignore property on
1526 directories. The output is suitable for appending to
1527 the $GIT_DIR/info/exclude file.
1528 </p>
1529 </dd>
1530 <dt class="hdlist1">
1531 <em>mkdirs</em>
1532 </dt>
1533 <dd>
1535 Attempts to recreate empty directories that core Git cannot track
1536 based on information in $GIT_DIR/svn/&lt;refname&gt;/unhandled.log files.
1537 Empty directories are automatically recreated when using
1538 "git svn clone" and "git svn rebase", so "mkdirs" is intended
1539 for use after commands like "git checkout" or "git reset".
1540 (See the svn-remote.&lt;name&gt;.automkdirs config file option for
1541 more information.)
1542 </p>
1543 </dd>
1544 <dt class="hdlist1">
1545 <em>commit-diff</em>
1546 </dt>
1547 <dd>
1549 Commits the diff of two tree-ish arguments from the
1550 command-line. This command does not rely on being inside a <code>git svn
1551 init</code>-ed repository. This command takes three arguments, (a) the
1552 original tree to diff against, (b) the new tree result, (c) the
1553 URL of the target Subversion repository. The final argument
1554 (URL) may be omitted if you are working from a <em>git svn</em>-aware
1555 repository (that has been <code>init</code>-ed with <em>git svn</em>).
1556 The -r&lt;revision&gt; option is required for this.
1557 </p>
1558 <div class="paragraph"><p>The commit message is supplied either directly with the <code>-m</code> or <code>-F</code>
1559 option, or indirectly from the tag or commit when the second tree-ish
1560 denotes such an object, or it is requested by invoking an editor (see
1561 <code>--edit</code> option below).</p></div>
1562 <div class="dlist"><dl>
1563 <dt class="hdlist1">
1564 -m &lt;msg&gt;
1565 </dt>
1566 <dt class="hdlist1">
1567 --message=&lt;msg&gt;
1568 </dt>
1569 <dd>
1571 Use the given <code>msg</code> as the commit message. This option
1572 disables the <code>--edit</code> option.
1573 </p>
1574 </dd>
1575 <dt class="hdlist1">
1576 -F &lt;filename&gt;
1577 </dt>
1578 <dt class="hdlist1">
1579 --file=&lt;filename&gt;
1580 </dt>
1581 <dd>
1583 Take the commit message from the given file. This option
1584 disables the <code>--edit</code> option.
1585 </p>
1586 </dd>
1587 </dl></div>
1588 </dd>
1589 <dt class="hdlist1">
1590 <em>info</em>
1591 </dt>
1592 <dd>
1594 Shows information about a file or directory similar to what
1595 &#8216;svn info&#8217; provides. Does not currently support a -r/--revision
1596 argument. Use the --url option to output only the value of the
1597 <em>URL:</em> field.
1598 </p>
1599 </dd>
1600 <dt class="hdlist1">
1601 <em>proplist</em>
1602 </dt>
1603 <dd>
1605 Lists the properties stored in the Subversion repository about a
1606 given file or directory. Use -r/--revision to refer to a specific
1607 Subversion revision.
1608 </p>
1609 </dd>
1610 <dt class="hdlist1">
1611 <em>propget</em>
1612 </dt>
1613 <dd>
1615 Gets the Subversion property given as the first argument, for a
1616 file. A specific revision can be specified with -r/--revision.
1617 </p>
1618 </dd>
1619 <dt class="hdlist1">
1620 <em>propset</em>
1621 </dt>
1622 <dd>
1624 Sets the Subversion property given as the first argument, to the
1625 value given as the second argument for the file given as the
1626 third argument.
1627 </p>
1628 <div class="paragraph"><p>Example:</p></div>
1629 <div class="listingblock">
1630 <div class="content">
1631 <pre><code>git svn propset svn:keywords "FreeBSD=%H" devel/py-tipper/Makefile</code></pre>
1632 </div></div>
1633 <div class="paragraph"><p>This will set the property <em>svn:keywords</em> to <em>FreeBSD=%H</em> for the file
1634 <em>devel/py-tipper/Makefile</em>.</p></div>
1635 </dd>
1636 <dt class="hdlist1">
1637 <em>show-externals</em>
1638 </dt>
1639 <dd>
1641 Shows the Subversion externals. Use -r/--revision to specify a
1642 specific revision.
1643 </p>
1644 </dd>
1645 <dt class="hdlist1">
1646 <em>gc</em>
1647 </dt>
1648 <dd>
1650 Compress $GIT_DIR/svn/&lt;refname&gt;/unhandled.log files and remove
1651 $GIT_DIR/svn/&lt;refname&gt;/index files.
1652 </p>
1653 </dd>
1654 <dt class="hdlist1">
1655 <em>reset</em>
1656 </dt>
1657 <dd>
1659 Undoes the effects of <em>fetch</em> back to the specified revision.
1660 This allows you to re-<em>fetch</em> an SVN revision. Normally the
1661 contents of an SVN revision should never change and <em>reset</em>
1662 should not be necessary. However, if SVN permissions change,
1663 or if you alter your --ignore-paths option, a <em>fetch</em> may fail
1664 with "not found in commit" (file not previously visible) or
1665 "checksum mismatch" (missed a modification). If the problem
1666 file cannot be ignored forever (with --ignore-paths) the only
1667 way to repair the repo is to use <em>reset</em>.
1668 </p>
1669 <div class="paragraph"><p>Only the rev_map and refs/remotes/git-svn are changed (see
1670 <em>$GIT_DIR/svn/**/.rev_map.*</em> in the FILES section below for details).
1671 Follow <em>reset</em> with a <em>fetch</em> and then <em>git reset</em> or <em>git rebase</em> to
1672 move local branches onto the new tree.</p></div>
1673 <div class="dlist"><dl>
1674 <dt class="hdlist1">
1675 -r &lt;n&gt;
1676 </dt>
1677 <dt class="hdlist1">
1678 --revision=&lt;n&gt;
1679 </dt>
1680 <dd>
1682 Specify the most recent revision to keep. All later revisions
1683 are discarded.
1684 </p>
1685 </dd>
1686 <dt class="hdlist1">
1688 </dt>
1689 <dt class="hdlist1">
1690 --parent
1691 </dt>
1692 <dd>
1694 Discard the specified revision as well, keeping the nearest
1695 parent instead.
1696 </p>
1697 </dd>
1698 <dt class="hdlist1">
1699 Example:
1700 </dt>
1701 <dd>
1703 Assume you have local changes in "master", but you need to refetch "r2".
1704 </p>
1705 <div class="listingblock">
1706 <div class="content">
1707 <pre><code> r1---r2---r3 remotes/git-svn
1709 A---B master</code></pre>
1710 </div></div>
1711 <div class="paragraph"><p>Fix the ignore-paths or SVN permissions problem that caused "r2" to
1712 be incomplete in the first place. Then:</p></div>
1713 <div class="verseblock">
1714 <pre class="content">git svn reset -r2 -p
1715 git svn fetch</pre>
1716 <div class="attribution">
1717 </div></div>
1718 <div class="listingblock">
1719 <div class="content">
1720 <pre><code> r1---r2'--r3' remotes/git-svn
1722 r2---r3---A---B master</code></pre>
1723 </div></div>
1724 <div class="paragraph"><p>Then fixup "master" with <em>git rebase</em>.
1725 Do NOT use <em>git merge</em> or your history will not be compatible with a
1726 future <em>dcommit</em>!</p></div>
1727 <div class="verseblock">
1728 <pre class="content">git rebase --onto remotes/git-svn A^ master</pre>
1729 <div class="attribution">
1730 </div></div>
1731 <div class="listingblock">
1732 <div class="content">
1733 <pre><code> r1---r2'--r3' remotes/git-svn
1735 A'--B' master</code></pre>
1736 </div></div>
1737 </dd>
1738 </dl></div>
1739 </dd>
1740 </dl></div>
1741 </div>
1742 </div>
1743 <div class="sect1">
1744 <h2 id="_options">OPTIONS</h2>
1745 <div class="sectionbody">
1746 <div class="dlist"><dl>
1747 <dt class="hdlist1">
1748 --shared[=(false|true|umask|group|all|world|everybody)]
1749 </dt>
1750 <dt class="hdlist1">
1751 --template=&lt;template-directory&gt;
1752 </dt>
1753 <dd>
1755 Only used with the <em>init</em> command.
1756 These are passed directly to <em>git init</em>.
1757 </p>
1758 </dd>
1759 <dt class="hdlist1">
1760 -r &lt;arg&gt;
1761 </dt>
1762 <dt class="hdlist1">
1763 --revision &lt;arg&gt;
1764 </dt>
1765 <dd>
1767 Used with the <em>fetch</em> command.
1768 </p>
1769 <div class="paragraph"><p>This allows revision ranges for partial/cauterized history
1770 to be supported. $NUMBER, $NUMBER1:$NUMBER2 (numeric ranges),
1771 $NUMBER:HEAD, and BASE:$NUMBER are all supported.</p></div>
1772 <div class="paragraph"><p>This can allow you to make partial mirrors when running fetch;
1773 but is generally not recommended because history will be skipped
1774 and lost.</p></div>
1775 </dd>
1776 <dt class="hdlist1">
1778 </dt>
1779 <dt class="hdlist1">
1780 --stdin
1781 </dt>
1782 <dd>
1784 Only used with the <em>set-tree</em> command.
1785 </p>
1786 <div class="paragraph"><p>Read a list of commits from stdin and commit them in reverse
1787 order. Only the leading sha1 is read from each line, so
1788 <em>git rev-list --pretty=oneline</em> output can be used.</p></div>
1789 </dd>
1790 <dt class="hdlist1">
1791 --rmdir
1792 </dt>
1793 <dd>
1795 Only used with the <em>dcommit</em>, <em>set-tree</em> and <em>commit-diff</em> commands.
1796 </p>
1797 <div class="paragraph"><p>Remove directories from the SVN tree if there are no files left
1798 behind. SVN can version empty directories, and they are not
1799 removed by default if there are no files left in them. Git
1800 cannot version empty directories. Enabling this flag will make
1801 the commit to SVN act like Git.</p></div>
1802 <div class="verseblock">
1803 <pre class="content">config key: svn.rmdir</pre>
1804 <div class="attribution">
1805 </div></div>
1806 </dd>
1807 <dt class="hdlist1">
1809 </dt>
1810 <dt class="hdlist1">
1811 --edit
1812 </dt>
1813 <dd>
1815 Only used with the <em>dcommit</em>, <em>set-tree</em> and <em>commit-diff</em> commands.
1816 </p>
1817 <div class="paragraph"><p>Edit the commit message before committing to SVN. This is off by
1818 default for objects that are commits, and forced on when committing
1819 tree objects.</p></div>
1820 <div class="verseblock">
1821 <pre class="content">config key: svn.edit</pre>
1822 <div class="attribution">
1823 </div></div>
1824 </dd>
1825 <dt class="hdlist1">
1826 -l&lt;num&gt;
1827 </dt>
1828 <dt class="hdlist1">
1829 --find-copies-harder
1830 </dt>
1831 <dd>
1833 Only used with the <em>dcommit</em>, <em>set-tree</em> and <em>commit-diff</em> commands.
1834 </p>
1835 <div class="paragraph"><p>They are both passed directly to <em>git diff-tree</em>; see
1836 <a href="git-diff-tree.html">git-diff-tree(1)</a> for more information.</p></div>
1837 <div class="verseblock">
1838 <pre class="content">config key: svn.l
1839 config key: svn.findcopiesharder</pre>
1840 <div class="attribution">
1841 </div></div>
1842 </dd>
1843 <dt class="hdlist1">
1844 -A&lt;filename&gt;
1845 </dt>
1846 <dt class="hdlist1">
1847 --authors-file=&lt;filename&gt;
1848 </dt>
1849 <dd>
1851 Syntax is compatible with the file used by <em>git cvsimport</em> but
1852 an empty email address can be supplied with <em>&lt;&gt;</em>:
1853 </p>
1854 <div class="listingblock">
1855 <div class="content">
1856 <pre><code> loginname = Joe User &lt;user@example.com&gt;</code></pre>
1857 </div></div>
1858 <div class="paragraph"><p>If this option is specified and <em>git svn</em> encounters an SVN
1859 committer name that does not exist in the authors-file, <em>git svn</em>
1860 will abort operation. The user will then have to add the
1861 appropriate entry. Re-running the previous <em>git svn</em> command
1862 after the authors-file is modified should continue operation.</p></div>
1863 <div class="verseblock">
1864 <pre class="content">config key: svn.authorsfile</pre>
1865 <div class="attribution">
1866 </div></div>
1867 </dd>
1868 <dt class="hdlist1">
1869 --authors-prog=&lt;filename&gt;
1870 </dt>
1871 <dd>
1873 If this option is specified, for each SVN committer name that
1874 does not exist in the authors file, the given file is executed
1875 with the committer name as the first argument. The program is
1876 expected to return a single line of the form "Name &lt;email&gt;" or
1877 "Name &lt;&gt;", which will be treated as if included in the authors
1878 file.
1879 </p>
1880 <div class="paragraph"><p>Due to historical reasons a relative <em>filename</em> is first searched
1881 relative to the current directory for <em>init</em> and <em>clone</em> and relative
1882 to the root of the working tree for <em>fetch</em>. If <em>filename</em> is
1883 not found, it is searched like any other command in <em>$PATH</em>.</p></div>
1884 <div class="verseblock">
1885 <pre class="content">config key: svn.authorsProg</pre>
1886 <div class="attribution">
1887 </div></div>
1888 </dd>
1889 <dt class="hdlist1">
1891 </dt>
1892 <dt class="hdlist1">
1893 --quiet
1894 </dt>
1895 <dd>
1897 Make <em>git svn</em> less verbose. Specify a second time to make it
1898 even less verbose.
1899 </p>
1900 </dd>
1901 <dt class="hdlist1">
1903 </dt>
1904 <dt class="hdlist1">
1905 --merge
1906 </dt>
1907 <dt class="hdlist1">
1908 -s&lt;strategy&gt;
1909 </dt>
1910 <dt class="hdlist1">
1911 --strategy=&lt;strategy&gt;
1912 </dt>
1913 <dt class="hdlist1">
1915 </dt>
1916 <dt class="hdlist1">
1917 --rebase-merges
1918 </dt>
1919 <dd>
1921 These are only used with the <em>dcommit</em> and <em>rebase</em> commands.
1922 </p>
1923 <div class="paragraph"><p>Passed directly to <em>git rebase</em> when using <em>dcommit</em> if a
1924 <em>git reset</em> cannot be used (see <em>dcommit</em>).</p></div>
1925 </dd>
1926 <dt class="hdlist1">
1928 </dt>
1929 <dt class="hdlist1">
1930 --dry-run
1931 </dt>
1932 <dd>
1934 This can be used with the <em>dcommit</em>, <em>rebase</em>, <em>branch</em> and
1935 <em>tag</em> commands.
1936 </p>
1937 <div class="paragraph"><p>For <em>dcommit</em>, print out the series of Git arguments that would show
1938 which diffs would be committed to SVN.</p></div>
1939 <div class="paragraph"><p>For <em>rebase</em>, display the local branch associated with the upstream svn
1940 repository associated with the current branch and the URL of svn
1941 repository that will be fetched from.</p></div>
1942 <div class="paragraph"><p>For <em>branch</em> and <em>tag</em>, display the urls that will be used for copying when
1943 creating the branch or tag.</p></div>
1944 </dd>
1945 <dt class="hdlist1">
1946 --use-log-author
1947 </dt>
1948 <dd>
1950 When retrieving svn commits into Git (as part of <em>fetch</em>, <em>rebase</em>, or
1951 <em>dcommit</em> operations), look for the first <code>From:</code> line or <code>Signed-off-by</code> trailer
1952 in the log message and use that as the author string.
1953 </p>
1954 <div class="verseblock">
1955 <pre class="content">config key: svn.useLogAuthor</pre>
1956 <div class="attribution">
1957 </div></div>
1958 </dd>
1959 <dt class="hdlist1">
1960 --add-author-from
1961 </dt>
1962 <dd>
1964 When committing to svn from Git (as part of <em>set-tree</em> or <em>dcommit</em>
1965 operations), if the existing log message doesn&#8217;t already have a
1966 <code>From:</code> or <code>Signed-off-by</code> trailer, append a <code>From:</code> line based on the
1967 Git commit&#8217;s author string. If you use this, then <code>--use-log-author</code>
1968 will retrieve a valid author string for all commits.
1969 </p>
1970 <div class="verseblock">
1971 <pre class="content">config key: svn.addAuthorFrom</pre>
1972 <div class="attribution">
1973 </div></div>
1974 </dd>
1975 </dl></div>
1976 </div>
1977 </div>
1978 <div class="sect1">
1979 <h2 id="_advanced_options">ADVANCED OPTIONS</h2>
1980 <div class="sectionbody">
1981 <div class="dlist"><dl>
1982 <dt class="hdlist1">
1983 -i&lt;GIT_SVN_ID&gt;
1984 </dt>
1985 <dt class="hdlist1">
1986 --id &lt;GIT_SVN_ID&gt;
1987 </dt>
1988 <dd>
1990 This sets GIT_SVN_ID (instead of using the environment). This
1991 allows the user to override the default refname to fetch from
1992 when tracking a single URL. The <em>log</em> and <em>dcommit</em> commands
1993 no longer require this switch as an argument.
1994 </p>
1995 </dd>
1996 <dt class="hdlist1">
1997 -R&lt;remote name&gt;
1998 </dt>
1999 <dt class="hdlist1">
2000 --svn-remote &lt;remote name&gt;
2001 </dt>
2002 <dd>
2004 Specify the [svn-remote "&lt;remote name&gt;"] section to use,
2005 this allows SVN multiple repositories to be tracked.
2006 Default: "svn"
2007 </p>
2008 </dd>
2009 <dt class="hdlist1">
2010 --follow-parent
2011 </dt>
2012 <dd>
2014 This option is only relevant if we are tracking branches (using
2015 one of the repository layout options --trunk, --tags,
2016 --branches, --stdlayout). For each tracked branch, try to find
2017 out where its revision was copied from, and set
2018 a suitable parent in the first Git commit for the branch.
2019 This is especially helpful when we&#8217;re tracking a directory
2020 that has been moved around within the repository. If this
2021 feature is disabled, the branches created by <em>git svn</em> will all
2022 be linear and not share any history, meaning that there will be
2023 no information on where branches were branched off or merged.
2024 However, following long/convoluted histories can take a long
2025 time, so disabling this feature may speed up the cloning
2026 process. This feature is enabled by default, use
2027 --no-follow-parent to disable it.
2028 </p>
2029 <div class="verseblock">
2030 <pre class="content">config key: svn.followparent</pre>
2031 <div class="attribution">
2032 </div></div>
2033 </dd>
2034 </dl></div>
2035 </div>
2036 </div>
2037 <div class="sect1">
2038 <h2 id="_config_file_only_options">CONFIG FILE-ONLY OPTIONS</h2>
2039 <div class="sectionbody">
2040 <div class="dlist"><dl>
2041 <dt class="hdlist1">
2042 svn.noMetadata
2043 </dt>
2044 <dt class="hdlist1">
2045 svn-remote.&lt;name&gt;.noMetadata
2046 </dt>
2047 <dd>
2049 This gets rid of the <em>git-svn-id:</em> lines at the end of every commit.
2050 </p>
2051 <div class="paragraph"><p>This option can only be used for one-shot imports as <em>git svn</em>
2052 will not be able to fetch again without metadata. Additionally,
2053 if you lose your <em>$GIT_DIR/svn/**/.rev_map.*</em> files, <em>git svn</em> will not
2054 be able to rebuild them.</p></div>
2055 <div class="paragraph"><p>The <em>git svn log</em> command will not work on repositories using
2056 this, either. Using this conflicts with the <em>useSvmProps</em>
2057 option for (hopefully) obvious reasons.</p></div>
2058 <div class="paragraph"><p>This option is NOT recommended as it makes it difficult to track down
2059 old references to SVN revision numbers in existing documentation, bug
2060 reports, and archives. If you plan to eventually migrate from SVN to
2061 Git and are certain about dropping SVN history, consider
2062 <a href="https://github.com/newren/git-filter-repo">git-filter-repo</a> instead.
2063 filter-repo also allows reformatting of metadata for ease-of-reading
2064 and rewriting authorship info for non-"svn.authorsFile" users.</p></div>
2065 </dd>
2066 <dt class="hdlist1">
2067 svn.useSvmProps
2068 </dt>
2069 <dt class="hdlist1">
2070 svn-remote.&lt;name&gt;.useSvmProps
2071 </dt>
2072 <dd>
2074 This allows <em>git svn</em> to re-map repository URLs and UUIDs from
2075 mirrors created using SVN::Mirror (or svk) for metadata.
2076 </p>
2077 <div class="paragraph"><p>If an SVN revision has a property, "svm:headrev", it is likely
2078 that the revision was created by SVN::Mirror (also used by SVK).
2079 The property contains a repository UUID and a revision. We want
2080 to make it look like we are mirroring the original URL, so
2081 introduce a helper function that returns the original identity
2082 URL and UUID, and use it when generating metadata in commit
2083 messages.</p></div>
2084 </dd>
2085 <dt class="hdlist1">
2086 svn.useSvnsyncProps
2087 </dt>
2088 <dt class="hdlist1">
2089 svn-remote.&lt;name&gt;.useSvnsyncprops
2090 </dt>
2091 <dd>
2093 Similar to the useSvmProps option; this is for users
2094 of the svnsync(1) command distributed with SVN 1.4.x and
2095 later.
2096 </p>
2097 </dd>
2098 <dt class="hdlist1">
2099 svn-remote.&lt;name&gt;.rewriteRoot
2100 </dt>
2101 <dd>
2103 This allows users to create repositories from alternate
2104 URLs. For example, an administrator could run <em>git svn</em> on the
2105 server locally (accessing via file://) but wish to distribute
2106 the repository with a public http:// or svn:// URL in the
2107 metadata so users of it will see the public URL.
2108 </p>
2109 </dd>
2110 <dt class="hdlist1">
2111 svn-remote.&lt;name&gt;.rewriteUUID
2112 </dt>
2113 <dd>
2115 Similar to the useSvmProps option; this is for users who need
2116 to remap the UUID manually. This may be useful in situations
2117 where the original UUID is not available via either useSvmProps
2118 or useSvnsyncProps.
2119 </p>
2120 </dd>
2121 <dt class="hdlist1">
2122 svn-remote.&lt;name&gt;.pushurl
2123 </dt>
2124 <dd>
2126 Similar to Git&#8217;s <code>remote.&lt;name&gt;.pushurl</code>, this key is designed
2127 to be used in cases where <em>url</em> points to an SVN repository
2128 via a read-only transport, to provide an alternate read/write
2129 transport. It is assumed that both keys point to the same
2130 repository. Unlike <em>commiturl</em>, <em>pushurl</em> is a base path. If
2131 either <em>commiturl</em> or <em>pushurl</em> could be used, <em>commiturl</em>
2132 takes precedence.
2133 </p>
2134 </dd>
2135 <dt class="hdlist1">
2136 svn.brokenSymlinkWorkaround
2137 </dt>
2138 <dd>
2140 This disables potentially expensive checks to workaround
2141 broken symlinks checked into SVN by broken clients. Set this
2142 option to "false" if you track a SVN repository with many
2143 empty blobs that are not symlinks. This option may be changed
2144 while <em>git svn</em> is running and take effect on the next
2145 revision fetched. If unset, <em>git svn</em> assumes this option to
2146 be "true".
2147 </p>
2148 </dd>
2149 <dt class="hdlist1">
2150 svn.pathnameencoding
2151 </dt>
2152 <dd>
2154 This instructs git svn to recode pathnames to a given encoding.
2155 It can be used by windows users and by those who work in non-utf8
2156 locales to avoid corrupted file names with non-ASCII characters.
2157 Valid encodings are the ones supported by Perl&#8217;s Encode module.
2158 </p>
2159 </dd>
2160 <dt class="hdlist1">
2161 svn-remote.&lt;name&gt;.automkdirs
2162 </dt>
2163 <dd>
2165 Normally, the "git svn clone" and "git svn rebase" commands
2166 attempt to recreate empty directories that are in the
2167 Subversion repository. If this option is set to "false", then
2168 empty directories will only be created if the "git svn mkdirs"
2169 command is run explicitly. If unset, <em>git svn</em> assumes this
2170 option to be "true".
2171 </p>
2172 </dd>
2173 </dl></div>
2174 <div class="paragraph"><p>Since the noMetadata, rewriteRoot, rewriteUUID, useSvnsyncProps and useSvmProps
2175 options all affect the metadata generated and used by <em>git svn</em>; they
2176 <strong>must</strong> be set in the configuration file before any history is imported
2177 and these settings should never be changed once they are set.</p></div>
2178 <div class="paragraph"><p>Additionally, only one of these options can be used per svn-remote
2179 section because they affect the <em>git-svn-id:</em> metadata line, except
2180 for rewriteRoot and rewriteUUID which can be used together.</p></div>
2181 </div>
2182 </div>
2183 <div class="sect1">
2184 <h2 id="_basic_examples">BASIC EXAMPLES</h2>
2185 <div class="sectionbody">
2186 <div class="paragraph"><p>Tracking and contributing to the trunk of a Subversion-managed project
2187 (ignoring tags and branches):</p></div>
2188 <div class="listingblock">
2189 <div class="content">
2190 <pre><code># Clone a repo (like git clone):
2191 git svn clone http://svn.example.com/project/trunk
2192 # Enter the newly cloned directory:
2193 cd trunk
2194 # You should be on master branch, double-check with 'git branch'
2195 git branch
2196 # Do some work and commit locally to Git:
2197 git commit ...
2198 # Something is committed to SVN, rebase your local changes against the
2199 # latest changes in SVN:
2200 git svn rebase
2201 # Now commit your changes (that were committed previously using Git) to SVN,
2202 # as well as automatically updating your working HEAD:
2203 git svn dcommit
2204 # Append svn:ignore settings to the default Git exclude file:
2205 git svn show-ignore &gt;&gt; .git/info/exclude</code></pre>
2206 </div></div>
2207 <div class="paragraph"><p>Tracking and contributing to an entire Subversion-managed project
2208 (complete with a trunk, tags and branches):</p></div>
2209 <div class="listingblock">
2210 <div class="content">
2211 <pre><code># Clone a repo with standard SVN directory layout (like git clone):
2212 git svn clone http://svn.example.com/project --stdlayout --prefix svn/
2213 # Or, if the repo uses a non-standard directory layout:
2214 git svn clone http://svn.example.com/project -T tr -b branch -t tag --prefix svn/
2215 # View all branches and tags you have cloned:
2216 git branch -r
2217 # Create a new branch in SVN
2218 git svn branch waldo
2219 # Reset your master to trunk (or any other branch, replacing 'trunk'
2220 # with the appropriate name):
2221 git reset --hard svn/trunk
2222 # You may only dcommit to one branch/tag/trunk at a time. The usage
2223 # of dcommit/rebase/show-ignore should be the same as above.</code></pre>
2224 </div></div>
2225 <div class="paragraph"><p>The initial <em>git svn clone</em> can be quite time-consuming
2226 (especially for large Subversion repositories). If multiple
2227 people (or one person with multiple machines) want to use
2228 <em>git svn</em> to interact with the same Subversion repository, you can
2229 do the initial <em>git svn clone</em> to a repository on a server and
2230 have each person clone that repository with <em>git clone</em>:</p></div>
2231 <div class="listingblock">
2232 <div class="content">
2233 <pre><code># Do the initial import on a server
2234 ssh server "cd /pub &amp;&amp; git svn clone http://svn.example.com/project [options...]"
2235 # Clone locally - make sure the refs/remotes/ space matches the server
2236 mkdir project
2237 cd project
2238 git init
2239 git remote add origin server:/pub/project
2240 git config --replace-all remote.origin.fetch '+refs/remotes/*:refs/remotes/*'
2241 git fetch
2242 # Prevent fetch/pull from remote Git server in the future,
2243 # we only want to use git svn for future updates
2244 git config --remove-section remote.origin
2245 # Create a local branch from one of the branches just fetched
2246 git checkout -b master FETCH_HEAD
2247 # Initialize 'git svn' locally (be sure to use the same URL and
2248 # --stdlayout/-T/-b/-t/--prefix options as were used on server)
2249 git svn init http://svn.example.com/project [options...]
2250 # Pull the latest changes from Subversion
2251 git svn rebase</code></pre>
2252 </div></div>
2253 </div>
2254 </div>
2255 <div class="sect1">
2256 <h2 id="_rebase_vs_pull_merge">REBASE VS. PULL/MERGE</h2>
2257 <div class="sectionbody">
2258 <div class="paragraph"><p>Prefer to use <em>git svn rebase</em> or <em>git rebase</em>, rather than
2259 <em>git pull</em> or <em>git merge</em> to synchronize unintegrated commits with a <em>git svn</em>
2260 branch. Doing so will keep the history of unintegrated commits linear with
2261 respect to the upstream SVN repository and allow the use of the preferred
2262 <em>git svn dcommit</em> subcommand to push unintegrated commits back into SVN.</p></div>
2263 <div class="paragraph"><p>Originally, <em>git svn</em> recommended that developers pulled or merged from
2264 the <em>git svn</em> branch. This was because the author favored
2265 <code>git svn set-tree B</code> to commit a single head rather than the
2266 <code>git svn set-tree A..B</code> notation to commit multiple commits. Use of
2267 <em>git pull</em> or <em>git merge</em> with <code>git svn set-tree A..B</code> will cause non-linear
2268 history to be flattened when committing into SVN and this can lead to merge
2269 commits unexpectedly reversing previous commits in SVN.</p></div>
2270 </div>
2271 </div>
2272 <div class="sect1">
2273 <h2 id="_merge_tracking">MERGE TRACKING</h2>
2274 <div class="sectionbody">
2275 <div class="paragraph"><p>While <em>git svn</em> can track
2276 copy history (including branches and tags) for repositories adopting a
2277 standard layout, it cannot yet represent merge history that happened
2278 inside git back upstream to SVN users. Therefore it is advised that
2279 users keep history as linear as possible inside Git to ease
2280 compatibility with SVN (see the CAVEATS section below).</p></div>
2281 </div>
2282 </div>
2283 <div class="sect1">
2284 <h2 id="_handling_of_svn_branches">HANDLING OF SVN BRANCHES</h2>
2285 <div class="sectionbody">
2286 <div class="paragraph"><p>If <em>git svn</em> is configured to fetch branches (and --follow-branches
2287 is in effect), it sometimes creates multiple Git branches for one
2288 SVN branch, where the additional branches have names of the form
2289 <em>branchname@nnn</em> (with nnn an SVN revision number). These additional
2290 branches are created if <em>git svn</em> cannot find a parent commit for the
2291 first commit in an SVN branch, to connect the branch to the history of
2292 the other branches.</p></div>
2293 <div class="paragraph"><p>Normally, the first commit in an SVN branch consists
2294 of a copy operation. <em>git svn</em> will read this commit to get the SVN
2295 revision the branch was created from. It will then try to find the
2296 Git commit that corresponds to this SVN revision, and use that as the
2297 parent of the branch. However, it is possible that there is no suitable
2298 Git commit to serve as parent. This will happen, among other reasons,
2299 if the SVN branch is a copy of a revision that was not fetched by <em>git
2300 svn</em> (e.g. because it is an old revision that was skipped with
2301 <code>--revision</code>), or if in SVN a directory was copied that is not tracked
2302 by <em>git svn</em> (such as a branch that is not tracked at all, or a
2303 subdirectory of a tracked branch). In these cases, <em>git svn</em> will still
2304 create a Git branch, but instead of using an existing Git commit as the
2305 parent of the branch, it will read the SVN history of the directory the
2306 branch was copied from and create appropriate Git commits. This is
2307 indicated by the message "Initializing parent: &lt;branchname&gt;".</p></div>
2308 <div class="paragraph"><p>Additionally, it will create a special branch named
2309 <em>&lt;branchname&gt;@&lt;SVN-Revision&gt;</em>, where &lt;SVN-Revision&gt; is the SVN revision
2310 number the branch was copied from. This branch will point to the newly
2311 created parent commit of the branch. If in SVN the branch was deleted
2312 and later recreated from a different version, there will be multiple
2313 such branches with an <em>@</em>.</p></div>
2314 <div class="paragraph"><p>Note that this may mean that multiple Git commits are created for a
2315 single SVN revision.</p></div>
2316 <div class="paragraph"><p>An example: in an SVN repository with a standard
2317 trunk/tags/branches layout, a directory trunk/sub is created in r.100.
2318 In r.200, trunk/sub is branched by copying it to branches/. <em>git svn
2319 clone -s</em> will then create a branch <em>sub</em>. It will also create new Git
2320 commits for r.100 through r.199 and use these as the history of branch
2321 <em>sub</em>. Thus there will be two Git commits for each revision from r.100
2322 to r.199 (one containing trunk/, one containing trunk/sub/). Finally,
2323 it will create a branch <em>sub@200</em> pointing to the new parent commit of
2324 branch <em>sub</em> (i.e. the commit for r.200 and trunk/sub/).</p></div>
2325 </div>
2326 </div>
2327 <div class="sect1">
2328 <h2 id="_caveats">CAVEATS</h2>
2329 <div class="sectionbody">
2330 <div class="paragraph"><p>For the sake of simplicity and interoperating with Subversion,
2331 it is recommended that all <em>git svn</em> users clone, fetch and dcommit
2332 directly from the SVN server, and avoid all <em>git clone</em>/<em>pull</em>/<em>merge</em>/<em>push</em>
2333 operations between Git repositories and branches. The recommended
2334 method of exchanging code between Git branches and users is
2335 <em>git format-patch</em> and <em>git am</em>, or just 'dcommit&#8217;ing to the SVN repository.</p></div>
2336 <div class="paragraph"><p>Running <em>git merge</em> or <em>git pull</em> is NOT recommended on a branch you
2337 plan to <em>dcommit</em> from because Subversion users cannot see any
2338 merges you&#8217;ve made. Furthermore, if you merge or pull from a Git branch
2339 that is a mirror of an SVN branch, <em>dcommit</em> may commit to the wrong
2340 branch.</p></div>
2341 <div class="paragraph"><p>If you do merge, note the following rule: <em>git svn dcommit</em> will
2342 attempt to commit on top of the SVN commit named in</p></div>
2343 <div class="listingblock">
2344 <div class="content">
2345 <pre><code>git log --grep=^git-svn-id: --first-parent -1</code></pre>
2346 </div></div>
2347 <div class="paragraph"><p>You <em>must</em> therefore ensure that the most recent commit of the branch
2348 you want to dcommit to is the <em>first</em> parent of the merge. Chaos will
2349 ensue otherwise, especially if the first parent is an older commit on
2350 the same SVN branch.</p></div>
2351 <div class="paragraph"><p><em>git clone</em> does not clone branches under the refs/remotes/ hierarchy or
2352 any <em>git svn</em> metadata, or config. So repositories created and managed with
2353 using <em>git svn</em> should use <em>rsync</em> for cloning, if cloning is to be done
2354 at all.</p></div>
2355 <div class="paragraph"><p>Since <em>dcommit</em> uses rebase internally, any Git branches you <em>git push</em> to
2356 before <em>dcommit</em> on will require forcing an overwrite of the existing ref
2357 on the remote repository. This is generally considered bad practice,
2358 see the <a href="git-push.html">git-push(1)</a> documentation for details.</p></div>
2359 <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
2360 already dcommitted. It is considered bad practice to --amend commits
2361 you&#8217;ve already pushed to a remote repository for other users, and
2362 dcommit with SVN is analogous to that.</p></div>
2363 <div class="paragraph"><p>When cloning an SVN repository, if none of the options for describing
2364 the repository layout is used (--trunk, --tags, --branches,
2365 --stdlayout), <em>git svn clone</em> will create a Git repository with
2366 completely linear history, where branches and tags appear as separate
2367 directories in the working copy. While this is the easiest way to get a
2368 copy of a complete repository, for projects with many branches it will
2369 lead to a working copy many times larger than just the trunk. Thus for
2370 projects using the standard directory structure (trunk/branches/tags),
2371 it is recommended to clone with option <code>--stdlayout</code>. If the project
2372 uses a non-standard structure, and/or if branches and tags are not
2373 required, it is easiest to only clone one directory (typically trunk),
2374 without giving any repository layout options. If the full history with
2375 branches and tags is required, the options <code>--trunk</code> / <code>--branches</code> /
2376 <code>--tags</code> must be used.</p></div>
2377 <div class="paragraph"><p>When using multiple --branches or --tags, <em>git svn</em> does not automatically
2378 handle name collisions (for example, if two branches from different paths have
2379 the same name, or if a branch and a tag have the same name). In these cases,
2380 use <em>init</em> to set up your Git repository then, before your first <em>fetch</em>, edit
2381 the $GIT_DIR/config file so that the branches and tags are associated
2382 with different name spaces. For example:</p></div>
2383 <div class="literalblock">
2384 <div class="content">
2385 <pre><code>branches = stable/*:refs/remotes/svn/stable/*
2386 branches = debug/*:refs/remotes/svn/debug/*</code></pre>
2387 </div></div>
2388 </div>
2389 </div>
2390 <div class="sect1">
2391 <h2 id="_configuration">CONFIGURATION</h2>
2392 <div class="sectionbody">
2393 <div class="paragraph"><p><em>git svn</em> stores [svn-remote] configuration information in the
2394 repository $GIT_DIR/config file. It is similar the core Git
2395 [remote] sections except <em>fetch</em> keys do not accept glob
2396 arguments; but they are instead handled by the <em>branches</em>
2397 and <em>tags</em> keys. Since some SVN repositories are oddly
2398 configured with multiple projects glob expansions such those
2399 listed below are allowed:</p></div>
2400 <div class="listingblock">
2401 <div class="content">
2402 <pre><code>[svn-remote "project-a"]
2403 url = http://server.org/svn
2404 fetch = trunk/project-a:refs/remotes/project-a/trunk
2405 branches = branches/*/project-a:refs/remotes/project-a/branches/*
2406 branches = branches/release_*:refs/remotes/project-a/branches/release_*
2407 branches = branches/re*se:refs/remotes/project-a/branches/*
2408 tags = tags/*/project-a:refs/remotes/project-a/tags/*</code></pre>
2409 </div></div>
2410 <div class="paragraph"><p>Keep in mind that the <code>*</code> (asterisk) wildcard of the local ref
2411 (right of the <code>:</code>) <strong>must</strong> be the farthest right path component;
2412 however the remote wildcard may be anywhere as long as it&#8217;s an
2413 independent path component (surrounded by <code>/</code> or EOL). This
2414 type of configuration is not automatically created by <em>init</em> and
2415 should be manually entered with a text-editor or using <em>git config</em>.</p></div>
2416 <div class="paragraph"><p>Also note that only one asterisk is allowed per word. For example:</p></div>
2417 <div class="literalblock">
2418 <div class="content">
2419 <pre><code>branches = branches/re*se:refs/remotes/project-a/branches/*</code></pre>
2420 </div></div>
2421 <div class="paragraph"><p>will match branches <em>release</em>, <em>rese</em>, <em>re123se</em>, however</p></div>
2422 <div class="literalblock">
2423 <div class="content">
2424 <pre><code>branches = branches/re*s*e:refs/remotes/project-a/branches/*</code></pre>
2425 </div></div>
2426 <div class="paragraph"><p>will produce an error.</p></div>
2427 <div class="paragraph"><p>It is also possible to fetch a subset of branches or tags by using a
2428 comma-separated list of names within braces. For example:</p></div>
2429 <div class="listingblock">
2430 <div class="content">
2431 <pre><code>[svn-remote "huge-project"]
2432 url = http://server.org/svn
2433 fetch = trunk/src:refs/remotes/trunk
2434 branches = branches/{red,green}/src:refs/remotes/project-a/branches/*
2435 tags = tags/{1.0,2.0}/src:refs/remotes/project-a/tags/*</code></pre>
2436 </div></div>
2437 <div class="paragraph"><p>Multiple fetch, branches, and tags keys are supported:</p></div>
2438 <div class="listingblock">
2439 <div class="content">
2440 <pre><code>[svn-remote "messy-repo"]
2441 url = http://server.org/svn
2442 fetch = trunk/project-a:refs/remotes/project-a/trunk
2443 fetch = branches/demos/june-project-a-demo:refs/remotes/project-a/demos/june-demo
2444 branches = branches/server/*:refs/remotes/project-a/branches/*
2445 branches = branches/demos/2011/*:refs/remotes/project-a/2011-demos/*
2446 tags = tags/server/*:refs/remotes/project-a/tags/*</code></pre>
2447 </div></div>
2448 <div class="paragraph"><p>Creating a branch in such a configuration requires disambiguating which
2449 location to use using the -d or --destination flag:</p></div>
2450 <div class="listingblock">
2451 <div class="content">
2452 <pre><code>$ git svn branch -d branches/server release-2-3-0</code></pre>
2453 </div></div>
2454 <div class="paragraph"><p>Note that git-svn keeps track of the highest revision in which a branch
2455 or tag has appeared. If the subset of branches or tags is changed after
2456 fetching, then $GIT_DIR/svn/.metadata must be manually edited to remove
2457 (or reset) branches-maxRev and/or tags-maxRev as appropriate.</p></div>
2458 </div>
2459 </div>
2460 <div class="sect1">
2461 <h2 id="_files">FILES</h2>
2462 <div class="sectionbody">
2463 <div class="dlist"><dl>
2464 <dt class="hdlist1">
2465 $GIT_DIR/svn/**/.rev_map.*
2466 </dt>
2467 <dd>
2469 Mapping between Subversion revision numbers and Git commit
2470 names. In a repository where the noMetadata option is not set,
2471 this can be rebuilt from the git-svn-id: lines that are at the
2472 end of every commit (see the <em>svn.noMetadata</em> section above for
2473 details).
2474 </p>
2475 <div class="paragraph"><p><em>git svn fetch</em> and <em>git svn rebase</em> automatically update the rev_map
2476 if it is missing or not up to date. <em>git svn reset</em> automatically
2477 rewinds it.</p></div>
2478 </dd>
2479 </dl></div>
2480 </div>
2481 </div>
2482 <div class="sect1">
2483 <h2 id="_bugs">BUGS</h2>
2484 <div class="sectionbody">
2485 <div class="paragraph"><p>We ignore all SVN properties except svn:executable. Any unhandled
2486 properties are logged to $GIT_DIR/svn/&lt;refname&gt;/unhandled.log</p></div>
2487 <div class="paragraph"><p>Renamed and copied directories are not detected by Git and hence not
2488 tracked when committing to SVN. I do not plan on adding support for
2489 this as it&#8217;s quite difficult and time-consuming to get working for all
2490 the possible corner cases (Git doesn&#8217;t do it, either). Committing
2491 renamed and copied files is fully supported if they&#8217;re similar enough
2492 for Git to detect them.</p></div>
2493 <div class="paragraph"><p>In SVN, it is possible (though discouraged) to commit changes to a tag
2494 (because a tag is just a directory copy, thus technically the same as a
2495 branch). When cloning an SVN repository, <em>git svn</em> cannot know if such a
2496 commit to a tag will happen in the future. Thus it acts conservatively
2497 and imports all SVN tags as branches, prefixing the tag name with <em>tags/</em>.</p></div>
2498 </div>
2499 </div>
2500 <div class="sect1">
2501 <h2 id="_see_also">SEE ALSO</h2>
2502 <div class="sectionbody">
2503 <div class="paragraph"><p><a href="git-rebase.html">git-rebase(1)</a></p></div>
2504 </div>
2505 </div>
2506 <div class="sect1">
2507 <h2 id="_git">GIT</h2>
2508 <div class="sectionbody">
2509 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
2510 </div>
2511 </div>
2512 </div>
2513 <div id="footnotes"><hr /></div>
2514 <div id="footer">
2515 <div id="footer-text">
2516 Last updated
2517 2021-12-10 14:52:02 PST
2518 </div>
2519 </div>
2520 </body>
2521 </html>