Autogenerated HTML docs for v1.7.7-237-g34c44
[git/jnareb-git.git] / git-svn.html
blob4cb01eb5cecf7a8d391a74742643b23ce84efdec
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 </dl></div>
968 </dd>
969 <dt class="hdlist1">
970 <em>branch</em>
971 </dt>
972 <dd>
974 Create a branch in the SVN repository.
975 </p>
976 <div class="dlist"><dl>
977 <dt class="hdlist1">
979 </dt>
980 <dt class="hdlist1">
981 --message
982 </dt>
983 <dd>
985 Allows to specify the commit message.
986 </p>
987 </dd>
988 <dt class="hdlist1">
990 </dt>
991 <dt class="hdlist1">
992 --tag
993 </dt>
994 <dd>
996 Create a tag by using the tags_subdir instead of the branches_subdir
997 specified during git svn init.
998 </p>
999 </dd>
1000 <dt class="hdlist1">
1002 </dt>
1003 <dt class="hdlist1">
1004 --destination
1005 </dt>
1006 <dd>
1008 If more than one --branches (or --tags) option was given to the <em>init</em>
1009 or <em>clone</em> command, you must provide the location of the branch (or
1010 tag) you wish to create in the SVN repository. The value of this
1011 option must match one of the paths specified by a --branches (or
1012 --tags) option. You can see these paths with the commands
1013 </p>
1014 <div class="literalblock">
1015 <div class="content">
1016 <pre><tt>git config --get-all svn-remote.&lt;name&gt;.branches
1017 git config --get-all svn-remote.&lt;name&gt;.tags</tt></pre>
1018 </div></div>
1019 <div class="paragraph"><p>where &lt;name&gt; is the name of the SVN repository as specified by the -R option to
1020 <em>init</em> (or "svn" by default).</p></div>
1021 </dd>
1022 <dt class="hdlist1">
1023 --username
1024 </dt>
1025 <dd>
1027 Specify the SVN username to perform the commit as. This option overrides
1028 the <em>username</em> configuration property.
1029 </p>
1030 </dd>
1031 <dt class="hdlist1">
1032 --commit-url
1033 </dt>
1034 <dd>
1036 Use the specified URL to connect to the destination Subversion
1037 repository. This is useful in cases where the source SVN
1038 repository is read-only. This option overrides configuration
1039 property <em>commiturl</em>.
1040 </p>
1041 <div class="literalblock">
1042 <div class="content">
1043 <pre><tt>git config --get-all svn-remote.&lt;name&gt;.commiturl</tt></pre>
1044 </div></div>
1045 </dd>
1046 </dl></div>
1047 </dd>
1048 <dt class="hdlist1">
1049 <em>tag</em>
1050 </dt>
1051 <dd>
1053 Create a tag in the SVN repository. This is a shorthand for
1054 <em>branch -t</em>.
1055 </p>
1056 </dd>
1057 <dt class="hdlist1">
1058 <em>log</em>
1059 </dt>
1060 <dd>
1062 This should make it easy to look up svn log messages when svn
1063 users refer to -r/--revision numbers.
1064 </p>
1065 <div class="paragraph"><p>The following features from &#8216;svn log&#8217; are supported:</p></div>
1066 <div class="dlist"><dl>
1067 <dt class="hdlist1">
1068 -r &lt;n&gt;[:&lt;n&gt;]
1069 </dt>
1070 <dt class="hdlist1">
1071 --revision=&lt;n&gt;[:&lt;n&gt;]
1072 </dt>
1073 <dd>
1075 is supported, non-numeric args are not:
1076 HEAD, NEXT, BASE, PREV, etc &#8230;
1077 </p>
1078 </dd>
1079 <dt class="hdlist1">
1081 </dt>
1082 <dt class="hdlist1">
1083 --verbose
1084 </dt>
1085 <dd>
1087 it&#8217;s not completely compatible with the --verbose
1088 output in svn log, but reasonably close.
1089 </p>
1090 </dd>
1091 <dt class="hdlist1">
1092 --limit=&lt;n&gt;
1093 </dt>
1094 <dd>
1096 is NOT the same as --max-count, doesn&#8217;t count
1097 merged/excluded commits
1098 </p>
1099 </dd>
1100 <dt class="hdlist1">
1101 --incremental
1102 </dt>
1103 <dd>
1105 supported
1106 </p>
1107 </dd>
1108 </dl></div>
1109 <div class="paragraph"><p>New features:</p></div>
1110 <div class="dlist"><dl>
1111 <dt class="hdlist1">
1112 --show-commit
1113 </dt>
1114 <dd>
1116 shows the git commit sha1, as well
1117 </p>
1118 </dd>
1119 <dt class="hdlist1">
1120 --oneline
1121 </dt>
1122 <dd>
1124 our version of --pretty=oneline
1125 </p>
1126 </dd>
1127 </dl></div>
1128 <div class="admonitionblock">
1129 <table><tr>
1130 <td class="icon">
1131 <div class="title">Note</div>
1132 </td>
1133 <td class="content">SVN itself only stores times in UTC and nothing else. The regular svn
1134 client converts the UTC time to the local time (or based on the TZ=
1135 environment). This command has the same behaviour.</td>
1136 </tr></table>
1137 </div>
1138 <div class="paragraph"><p>Any other arguments are passed directly to <em>git log</em></p></div>
1139 </dd>
1140 <dt class="hdlist1">
1141 <em>blame</em>
1142 </dt>
1143 <dd>
1145 Show what revision and author last modified each line of a file. The
1146 output of this mode is format-compatible with the output of
1147 &#8216;svn blame&#8217; by default. Like the SVN blame command,
1148 local uncommitted changes in the working tree are ignored;
1149 the version of the file in the HEAD revision is annotated. Unknown
1150 arguments are passed directly to <em>git blame</em>.
1151 </p>
1152 <div class="dlist"><dl>
1153 <dt class="hdlist1">
1154 --git-format
1155 </dt>
1156 <dd>
1158 Produce output in the same format as <em>git blame</em>, but with
1159 SVN revision numbers instead of git commit hashes. In this mode,
1160 changes that haven&#8217;t been committed to SVN (including local
1161 working-copy edits) are shown as revision 0.
1162 </p>
1163 </dd>
1164 </dl></div>
1165 </dd>
1166 <dt class="hdlist1">
1167 <em>find-rev</em>
1168 </dt>
1169 <dd>
1171 When given an SVN revision number of the form <em>rN</em>, returns the
1172 corresponding git commit hash (this can optionally be followed by a
1173 tree-ish to specify which branch should be searched). When given a
1174 tree-ish, returns the corresponding SVN revision number.
1175 </p>
1176 </dd>
1177 <dt class="hdlist1">
1178 <em>set-tree</em>
1179 </dt>
1180 <dd>
1182 You should consider using <em>dcommit</em> instead of this command.
1183 Commit specified commit or tree objects to SVN. This relies on
1184 your imported fetch data being up-to-date. This makes
1185 absolutely no attempts to do patching when committing to SVN, it
1186 simply overwrites files with those specified in the tree or
1187 commit. All merging is assumed to have taken place
1188 independently of <em>git svn</em> functions.
1189 </p>
1190 </dd>
1191 <dt class="hdlist1">
1192 <em>create-ignore</em>
1193 </dt>
1194 <dd>
1196 Recursively finds the svn:ignore property on directories and
1197 creates matching .gitignore files. The resulting files are staged to
1198 be committed, but are not committed. Use -r/--revision to refer to a
1199 specific revision.
1200 </p>
1201 </dd>
1202 <dt class="hdlist1">
1203 <em>show-ignore</em>
1204 </dt>
1205 <dd>
1207 Recursively finds and lists the svn:ignore property on
1208 directories. The output is suitable for appending to
1209 the $GIT_DIR/info/exclude file.
1210 </p>
1211 </dd>
1212 <dt class="hdlist1">
1213 <em>mkdirs</em>
1214 </dt>
1215 <dd>
1217 Attempts to recreate empty directories that core git cannot track
1218 based on information in $GIT_DIR/svn/&lt;refname&gt;/unhandled.log files.
1219 Empty directories are automatically recreated when using
1220 "git svn clone" and "git svn rebase", so "mkdirs" is intended
1221 for use after commands like "git checkout" or "git reset".
1222 (See the svn-remote.&lt;name&gt;.automkdirs config file option for
1223 more information.)
1224 </p>
1225 </dd>
1226 <dt class="hdlist1">
1227 <em>commit-diff</em>
1228 </dt>
1229 <dd>
1231 Commits the diff of two tree-ish arguments from the
1232 command-line. This command does not rely on being inside an <tt>git svn
1233 init</tt>-ed repository. This command takes three arguments, (a) the
1234 original tree to diff against, (b) the new tree result, (c) the
1235 URL of the target Subversion repository. The final argument
1236 (URL) may be omitted if you are working from a <em>git svn</em>-aware
1237 repository (that has been <tt>init</tt>-ed with <em>git svn</em>).
1238 The -r&lt;revision&gt; option is required for this.
1239 </p>
1240 </dd>
1241 <dt class="hdlist1">
1242 <em>info</em>
1243 </dt>
1244 <dd>
1246 Shows information about a file or directory similar to what
1247 &#8216;svn info&#8217; provides. Does not currently support a -r/--revision
1248 argument. Use the --url option to output only the value of the
1249 <em>URL:</em> field.
1250 </p>
1251 </dd>
1252 <dt class="hdlist1">
1253 <em>proplist</em>
1254 </dt>
1255 <dd>
1257 Lists the properties stored in the Subversion repository about a
1258 given file or directory. Use -r/--revision to refer to a specific
1259 Subversion revision.
1260 </p>
1261 </dd>
1262 <dt class="hdlist1">
1263 <em>propget</em>
1264 </dt>
1265 <dd>
1267 Gets the Subversion property given as the first argument, for a
1268 file. A specific revision can be specified with -r/--revision.
1269 </p>
1270 </dd>
1271 <dt class="hdlist1">
1272 <em>show-externals</em>
1273 </dt>
1274 <dd>
1276 Shows the Subversion externals. Use -r/--revision to specify a
1277 specific revision.
1278 </p>
1279 </dd>
1280 <dt class="hdlist1">
1281 <em>gc</em>
1282 </dt>
1283 <dd>
1285 Compress $GIT_DIR/svn/&lt;refname&gt;/unhandled.log files in .git/svn
1286 and remove $GIT_DIR/svn/&lt;refname&gt;index files in .git/svn.
1287 </p>
1288 </dd>
1289 <dt class="hdlist1">
1290 <em>reset</em>
1291 </dt>
1292 <dd>
1294 Undoes the effects of <em>fetch</em> back to the specified revision.
1295 This allows you to re-<em>fetch</em> an SVN revision. Normally the
1296 contents of an SVN revision should never change and <em>reset</em>
1297 should not be necessary. However, if SVN permissions change,
1298 or if you alter your --ignore-paths option, a <em>fetch</em> may fail
1299 with "not found in commit" (file not previously visible) or
1300 "checksum mismatch" (missed a modification). If the problem
1301 file cannot be ignored forever (with --ignore-paths) the only
1302 way to repair the repo is to use <em>reset</em>.
1303 </p>
1304 <div class="paragraph"><p>Only the rev_map and refs/remotes/git-svn are changed. Follow <em>reset</em>
1305 with a <em>fetch</em> and then <em>git reset</em> or <em>git rebase</em> to move local
1306 branches onto the new tree.</p></div>
1307 <div class="dlist"><dl>
1308 <dt class="hdlist1">
1309 -r &lt;n&gt;
1310 </dt>
1311 <dt class="hdlist1">
1312 --revision=&lt;n&gt;
1313 </dt>
1314 <dd>
1316 Specify the most recent revision to keep. All later revisions
1317 are discarded.
1318 </p>
1319 </dd>
1320 <dt class="hdlist1">
1322 </dt>
1323 <dt class="hdlist1">
1324 --parent
1325 </dt>
1326 <dd>
1328 Discard the specified revision as well, keeping the nearest
1329 parent instead.
1330 </p>
1331 </dd>
1332 <dt class="hdlist1">
1333 Example:
1334 </dt>
1335 <dd>
1337 Assume you have local changes in "master", but you need to refetch "r2".
1338 </p>
1339 <div class="listingblock">
1340 <div class="content">
1341 <pre><tt> r1---r2---r3 remotes/git-svn
1343 A---B master</tt></pre>
1344 </div></div>
1345 <div class="paragraph"><p>Fix the ignore-paths or SVN permissions problem that caused "r2" to
1346 be incomplete in the first place. Then:</p></div>
1347 <div class="verseblock">
1348 <div class="verseblock-content">git svn reset -r2 -p
1349 git svn fetch</div>
1350 <div class="verseblock-attribution">
1351 </div></div>
1352 <div class="listingblock">
1353 <div class="content">
1354 <pre><tt> r1---r2'--r3' remotes/git-svn
1356 r2---r3---A---B master</tt></pre>
1357 </div></div>
1358 <div class="paragraph"><p>Then fixup "master" with <em>git rebase</em>.
1359 Do NOT use <em>git merge</em> or your history will not be compatible with a
1360 future <em>dcommit</em>!</p></div>
1361 <div class="verseblock">
1362 <div class="verseblock-content">git rebase --onto remotes/git-svn A^ master</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 A'--B' master</tt></pre>
1370 </div></div>
1371 </dd>
1372 </dl></div>
1373 </dd>
1374 </dl></div>
1375 </div>
1376 <h2 id="_options">OPTIONS</h2>
1377 <div class="sectionbody">
1378 <div class="dlist"><dl>
1379 <dt class="hdlist1">
1380 --shared[=(false|true|umask|group|all|world|everybody)]
1381 </dt>
1382 <dt class="hdlist1">
1383 --template=&lt;template_directory&gt;
1384 </dt>
1385 <dd>
1387 Only used with the <em>init</em> command.
1388 These are passed directly to <em>git init</em>.
1389 </p>
1390 </dd>
1391 <dt class="hdlist1">
1392 -r &lt;arg&gt;
1393 </dt>
1394 <dt class="hdlist1">
1395 --revision &lt;arg&gt;
1396 </dt>
1397 <dd>
1399 Used with the <em>fetch</em> command.
1400 </p>
1401 <div class="paragraph"><p>This allows revision ranges for partial/cauterized history
1402 to be supported. $NUMBER, $NUMBER1:$NUMBER2 (numeric ranges),
1403 $NUMBER:HEAD, and BASE:$NUMBER are all supported.</p></div>
1404 <div class="paragraph"><p>This can allow you to make partial mirrors when running fetch;
1405 but is generally not recommended because history will be skipped
1406 and lost.</p></div>
1407 </dd>
1408 <dt class="hdlist1">
1410 </dt>
1411 <dt class="hdlist1">
1412 --stdin
1413 </dt>
1414 <dd>
1416 Only used with the <em>set-tree</em> command.
1417 </p>
1418 <div class="paragraph"><p>Read a list of commits from stdin and commit them in reverse
1419 order. Only the leading sha1 is read from each line, so
1420 <em>git rev-list --pretty=oneline</em> output can be used.</p></div>
1421 </dd>
1422 <dt class="hdlist1">
1423 --rmdir
1424 </dt>
1425 <dd>
1427 Only used with the <em>dcommit</em>, <em>set-tree</em> and <em>commit-diff</em> commands.
1428 </p>
1429 <div class="paragraph"><p>Remove directories from the SVN tree if there are no files left
1430 behind. SVN can version empty directories, and they are not
1431 removed by default if there are no files left in them. git
1432 cannot version empty directories. Enabling this flag will make
1433 the commit to SVN act like git.</p></div>
1434 <div class="verseblock">
1435 <div class="verseblock-content">config key: svn.rmdir</div>
1436 <div class="verseblock-attribution">
1437 </div></div>
1438 </dd>
1439 <dt class="hdlist1">
1441 </dt>
1442 <dt class="hdlist1">
1443 --edit
1444 </dt>
1445 <dd>
1447 Only used with the <em>dcommit</em>, <em>set-tree</em> and <em>commit-diff</em> commands.
1448 </p>
1449 <div class="paragraph"><p>Edit the commit message before committing to SVN. This is off by
1450 default for objects that are commits, and forced on when committing
1451 tree objects.</p></div>
1452 <div class="verseblock">
1453 <div class="verseblock-content">config key: svn.edit</div>
1454 <div class="verseblock-attribution">
1455 </div></div>
1456 </dd>
1457 <dt class="hdlist1">
1458 -l&lt;num&gt;
1459 </dt>
1460 <dt class="hdlist1">
1461 --find-copies-harder
1462 </dt>
1463 <dd>
1465 Only used with the <em>dcommit</em>, <em>set-tree</em> and <em>commit-diff</em> commands.
1466 </p>
1467 <div class="paragraph"><p>They are both passed directly to <em>git diff-tree</em>; see
1468 <a href="git-diff-tree.html">git-diff-tree(1)</a> for more information.</p></div>
1469 <div class="verseblock">
1470 <div class="verseblock-content">config key: svn.l
1471 config key: svn.findcopiesharder</div>
1472 <div class="verseblock-attribution">
1473 </div></div>
1474 </dd>
1475 <dt class="hdlist1">
1476 -A&lt;filename&gt;
1477 </dt>
1478 <dt class="hdlist1">
1479 --authors-file=&lt;filename&gt;
1480 </dt>
1481 <dd>
1483 Syntax is compatible with the file used by <em>git cvsimport</em>:
1484 </p>
1485 <div class="listingblock">
1486 <div class="content">
1487 <pre><tt> loginname = Joe User &lt;user@example.com&gt;</tt></pre>
1488 </div></div>
1489 <div class="paragraph"><p>If this option is specified and <em>git svn</em> encounters an SVN
1490 committer name that does not exist in the authors-file, <em>git svn</em>
1491 will abort operation. The user will then have to add the
1492 appropriate entry. Re-running the previous <em>git svn</em> command
1493 after the authors-file is modified should continue operation.</p></div>
1494 <div class="verseblock">
1495 <div class="verseblock-content">config key: svn.authorsfile</div>
1496 <div class="verseblock-attribution">
1497 </div></div>
1498 </dd>
1499 <dt class="hdlist1">
1500 --authors-prog=&lt;filename&gt;
1501 </dt>
1502 <dd>
1504 If this option is specified, for each SVN committer name that
1505 does not exist in the authors file, the given file is executed
1506 with the committer name as the first argument. The program is
1507 expected to return a single line of the form "Name &lt;email&gt;",
1508 which will be treated as if included in the authors file.
1509 </p>
1510 </dd>
1511 <dt class="hdlist1">
1513 </dt>
1514 <dt class="hdlist1">
1515 --quiet
1516 </dt>
1517 <dd>
1519 Make <em>git svn</em> less verbose. Specify a second time to make it
1520 even less verbose.
1521 </p>
1522 </dd>
1523 <dt class="hdlist1">
1524 --repack[=&lt;n&gt;]
1525 </dt>
1526 <dt class="hdlist1">
1527 --repack-flags=&lt;flags&gt;
1528 </dt>
1529 <dd>
1531 These should help keep disk usage sane for large fetches with
1532 many revisions.
1533 </p>
1534 <div class="paragraph"><p>--repack takes an optional argument for the number of revisions
1535 to fetch before repacking. This defaults to repacking every
1536 1000 commits fetched if no argument is specified.</p></div>
1537 <div class="paragraph"><p>--repack-flags are passed directly to <em>git repack</em>.</p></div>
1538 <div class="verseblock">
1539 <div class="verseblock-content">config key: svn.repack
1540 config key: svn.repackflags</div>
1541 <div class="verseblock-attribution">
1542 </div></div>
1543 </dd>
1544 <dt class="hdlist1">
1546 </dt>
1547 <dt class="hdlist1">
1548 --merge
1549 </dt>
1550 <dt class="hdlist1">
1551 -s&lt;strategy&gt;
1552 </dt>
1553 <dt class="hdlist1">
1554 --strategy=&lt;strategy&gt;
1555 </dt>
1556 <dd>
1558 These are only used with the <em>dcommit</em> and <em>rebase</em> commands.
1559 </p>
1560 <div class="paragraph"><p>Passed directly to <em>git rebase</em> when using <em>dcommit</em> if a
1561 <em>git reset</em> cannot be used (see <em>dcommit</em>).</p></div>
1562 </dd>
1563 <dt class="hdlist1">
1565 </dt>
1566 <dt class="hdlist1">
1567 --dry-run
1568 </dt>
1569 <dd>
1571 This can be used with the <em>dcommit</em>, <em>rebase</em>, <em>branch</em> and
1572 <em>tag</em> commands.
1573 </p>
1574 <div class="paragraph"><p>For <em>dcommit</em>, print out the series of git arguments that would show
1575 which diffs would be committed to SVN.</p></div>
1576 <div class="paragraph"><p>For <em>rebase</em>, display the local branch associated with the upstream svn
1577 repository associated with the current branch and the URL of svn
1578 repository that will be fetched from.</p></div>
1579 <div class="paragraph"><p>For <em>branch</em> and <em>tag</em>, display the urls that will be used for copying when
1580 creating the branch or tag.</p></div>
1581 </dd>
1582 <dt class="hdlist1">
1583 --use-log-author
1584 </dt>
1585 <dd>
1587 When retrieving svn commits into git (as part of <em>fetch</em>, <em>rebase</em>, or
1588 <em>dcommit</em> operations), look for the first <tt>From:</tt> or <tt>Signed-off-by:</tt> line
1589 in the log message and use that as the author string.
1590 </p>
1591 </dd>
1592 <dt class="hdlist1">
1593 --add-author-from
1594 </dt>
1595 <dd>
1597 When committing to svn from git (as part of <em>commit-diff</em>, <em>set-tree</em> or <em>dcommit</em>
1598 operations), if the existing log message doesn&#8217;t already have a
1599 <tt>From:</tt> or <tt>Signed-off-by:</tt> line, append a <tt>From:</tt> line based on the
1600 git commit&#8217;s author string. If you use this, then <tt>--use-log-author</tt>
1601 will retrieve a valid author string for all commits.
1602 </p>
1603 </dd>
1604 </dl></div>
1605 </div>
1606 <h2 id="_advanced_options">ADVANCED OPTIONS</h2>
1607 <div class="sectionbody">
1608 <div class="dlist"><dl>
1609 <dt class="hdlist1">
1610 -i&lt;GIT_SVN_ID&gt;
1611 </dt>
1612 <dt class="hdlist1">
1613 --id &lt;GIT_SVN_ID&gt;
1614 </dt>
1615 <dd>
1617 This sets GIT_SVN_ID (instead of using the environment). This
1618 allows the user to override the default refname to fetch from
1619 when tracking a single URL. The <em>log</em> and <em>dcommit</em> commands
1620 no longer require this switch as an argument.
1621 </p>
1622 </dd>
1623 <dt class="hdlist1">
1624 -R&lt;remote name&gt;
1625 </dt>
1626 <dt class="hdlist1">
1627 --svn-remote &lt;remote name&gt;
1628 </dt>
1629 <dd>
1631 Specify the [svn-remote "&lt;remote name&gt;"] section to use,
1632 this allows SVN multiple repositories to be tracked.
1633 Default: "svn"
1634 </p>
1635 </dd>
1636 <dt class="hdlist1">
1637 --follow-parent
1638 </dt>
1639 <dd>
1641 This is especially helpful when we&#8217;re tracking a directory
1642 that has been moved around within the repository, or if we
1643 started tracking a branch and never tracked the trunk it was
1644 descended from. This feature is enabled by default, use
1645 --no-follow-parent to disable it.
1646 </p>
1647 <div class="verseblock">
1648 <div class="verseblock-content">config key: svn.followparent</div>
1649 <div class="verseblock-attribution">
1650 </div></div>
1651 </dd>
1652 </dl></div>
1653 </div>
1654 <h2 id="_config_file_only_options">CONFIG FILE-ONLY OPTIONS</h2>
1655 <div class="sectionbody">
1656 <div class="dlist"><dl>
1657 <dt class="hdlist1">
1658 svn.noMetadata
1659 </dt>
1660 <dt class="hdlist1">
1661 svn-remote.&lt;name&gt;.noMetadata
1662 </dt>
1663 <dd>
1665 This gets rid of the <em>git-svn-id:</em> lines at the end of every commit.
1666 </p>
1667 <div class="paragraph"><p>This option can only be used for one-shot imports as <em>git svn</em>
1668 will not be able to fetch again without metadata. Additionally,
1669 if you lose your .git/svn/<strong>*/.rev_map.</strong> files, <em>git svn</em> will not
1670 be able to rebuild them.</p></div>
1671 <div class="paragraph"><p>The <em>git svn log</em> command will not work on repositories using
1672 this, either. Using this conflicts with the <em>useSvmProps</em>
1673 option for (hopefully) obvious reasons.</p></div>
1674 <div class="paragraph"><p>This option is NOT recommended as it makes it difficult to track down
1675 old references to SVN revision numbers in existing documentation, bug
1676 reports and archives. If you plan to eventually migrate from SVN to git
1677 and are certain about dropping SVN history, consider
1678 <a href="git-filter-branch.html">git-filter-branch(1)</a> instead. filter-branch also allows
1679 reformatting of metadata for ease-of-reading and rewriting authorship
1680 info for non-"svn.authorsFile" users.</p></div>
1681 </dd>
1682 <dt class="hdlist1">
1683 svn.useSvmProps
1684 </dt>
1685 <dt class="hdlist1">
1686 svn-remote.&lt;name&gt;.useSvmProps
1687 </dt>
1688 <dd>
1690 This allows <em>git svn</em> to re-map repository URLs and UUIDs from
1691 mirrors created using SVN::Mirror (or svk) for metadata.
1692 </p>
1693 <div class="paragraph"><p>If an SVN revision has a property, "svm:headrev", it is likely
1694 that the revision was created by SVN::Mirror (also used by SVK).
1695 The property contains a repository UUID and a revision. We want
1696 to make it look like we are mirroring the original URL, so
1697 introduce a helper function that returns the original identity
1698 URL and UUID, and use it when generating metadata in commit
1699 messages.</p></div>
1700 </dd>
1701 <dt class="hdlist1">
1702 svn.useSvnsyncProps
1703 </dt>
1704 <dt class="hdlist1">
1705 svn-remote.&lt;name&gt;.useSvnsyncprops
1706 </dt>
1707 <dd>
1709 Similar to the useSvmProps option; this is for users
1710 of the svnsync(1) command distributed with SVN 1.4.x and
1711 later.
1712 </p>
1713 </dd>
1714 <dt class="hdlist1">
1715 svn-remote.&lt;name&gt;.rewriteRoot
1716 </dt>
1717 <dd>
1719 This allows users to create repositories from alternate
1720 URLs. For example, an administrator could run <em>git svn</em> on the
1721 server locally (accessing via file://) but wish to distribute
1722 the repository with a public http:// or svn:// URL in the
1723 metadata so users of it will see the public URL.
1724 </p>
1725 </dd>
1726 <dt class="hdlist1">
1727 svn-remote.&lt;name&gt;.rewriteUUID
1728 </dt>
1729 <dd>
1731 Similar to the useSvmProps option; this is for users who need
1732 to remap the UUID manually. This may be useful in situations
1733 where the original UUID is not available via either useSvmProps
1734 or useSvnsyncProps.
1735 </p>
1736 </dd>
1737 <dt class="hdlist1">
1738 svn-remote.&lt;name&gt;.pushurl
1739 </dt>
1740 <dd>
1742 Similar to git&#8217;s <em>remote.&lt;name&gt;.pushurl</em>, this key is designed
1743 to be used in cases where <em>url</em> points to an SVN repository
1744 via a read-only transport, to provide an alternate read/write
1745 transport. It is assumed that both keys point to the same
1746 repository. Unlike <em>commiturl</em>, <em>pushurl</em> is a base path. If
1747 either <em>commiturl</em> or <em>pushurl</em> could be used, <em>commiturl</em>
1748 takes precedence.
1749 </p>
1750 </dd>
1751 <dt class="hdlist1">
1752 svn.brokenSymlinkWorkaround
1753 </dt>
1754 <dd>
1756 This disables potentially expensive checks to workaround
1757 broken symlinks checked into SVN by broken clients. Set this
1758 option to "false" if you track a SVN repository with many
1759 empty blobs that are not symlinks. This option may be changed
1760 while <em>git svn</em> is running and take effect on the next
1761 revision fetched. If unset, <em>git svn</em> assumes this option to
1762 be "true".
1763 </p>
1764 </dd>
1765 <dt class="hdlist1">
1766 svn.pathnameencoding
1767 </dt>
1768 <dd>
1770 This instructs git svn to recode pathnames to a given encoding.
1771 It can be used by windows users and by those who work in non-utf8
1772 locales to avoid corrupted file names with non-ASCII characters.
1773 Valid encodings are the ones supported by Perl&#8217;s Encode module.
1774 </p>
1775 </dd>
1776 <dt class="hdlist1">
1777 svn-remote.&lt;name&gt;.automkdirs
1778 </dt>
1779 <dd>
1781 Normally, the "git svn clone" and "git svn rebase" commands
1782 attempt to recreate empty directories that are in the
1783 Subversion repository. If this option is set to "false", then
1784 empty directories will only be created if the "git svn mkdirs"
1785 command is run explicitly. If unset, <em>git svn</em> assumes this
1786 option to be "true".
1787 </p>
1788 </dd>
1789 </dl></div>
1790 <div class="paragraph"><p>Since the noMetadata, rewriteRoot, rewriteUUID, useSvnsyncProps and useSvmProps
1791 options all affect the metadata generated and used by <em>git svn</em>; they
1792 <strong>must</strong> be set in the configuration file before any history is imported
1793 and these settings should never be changed once they are set.</p></div>
1794 <div class="paragraph"><p>Additionally, only one of these options can be used per svn-remote
1795 section because they affect the <em>git-svn-id:</em> metadata line, except
1796 for rewriteRoot and rewriteUUID which can be used together.</p></div>
1797 </div>
1798 <h2 id="_basic_examples">BASIC EXAMPLES</h2>
1799 <div class="sectionbody">
1800 <div class="paragraph"><p>Tracking and contributing to the trunk of a Subversion-managed project:</p></div>
1801 <div class="listingblock">
1802 <div class="content">
1803 <pre><tt># Clone a repo (like git clone):
1804 git svn clone http://svn.example.com/project/trunk
1805 # Enter the newly cloned directory:
1806 cd trunk
1807 # You should be on master branch, double-check with 'git branch'
1808 git branch
1809 # Do some work and commit locally to git:
1810 git commit ...
1811 # Something is committed to SVN, rebase your local changes against the
1812 # latest changes in SVN:
1813 git svn rebase
1814 # Now commit your changes (that were committed previously using git) to SVN,
1815 # as well as automatically updating your working HEAD:
1816 git svn dcommit
1817 # Append svn:ignore settings to the default git exclude file:
1818 git svn show-ignore &gt;&gt; .git/info/exclude</tt></pre>
1819 </div></div>
1820 <div class="paragraph"><p>Tracking and contributing to an entire Subversion-managed project
1821 (complete with a trunk, tags and branches):</p></div>
1822 <div class="listingblock">
1823 <div class="content">
1824 <pre><tt># Clone a repo (like git clone):
1825 git svn clone http://svn.example.com/project -T trunk -b branches -t tags
1826 # View all branches and tags you have cloned:
1827 git branch -r
1828 # Create a new branch in SVN
1829 git svn branch waldo
1830 # Reset your master to trunk (or any other branch, replacing 'trunk'
1831 # with the appropriate name):
1832 git reset --hard remotes/trunk
1833 # You may only dcommit to one branch/tag/trunk at a time. The usage
1834 # of dcommit/rebase/show-ignore should be the same as above.</tt></pre>
1835 </div></div>
1836 <div class="paragraph"><p>The initial <em>git svn clone</em> can be quite time-consuming
1837 (especially for large Subversion repositories). If multiple
1838 people (or one person with multiple machines) want to use
1839 <em>git svn</em> to interact with the same Subversion repository, you can
1840 do the initial <em>git svn clone</em> to a repository on a server and
1841 have each person clone that repository with <em>git clone</em>:</p></div>
1842 <div class="listingblock">
1843 <div class="content">
1844 <pre><tt># Do the initial import on a server
1845 ssh server "cd /pub &amp;&amp; git svn clone http://svn.example.com/project
1846 # Clone locally - make sure the refs/remotes/ space matches the server
1847 mkdir project
1848 cd project
1849 git init
1850 git remote add origin server:/pub/project
1851 git config --replace-all remote.origin.fetch '+refs/remotes/*:refs/remotes/*'
1852 git fetch
1853 # Prevent fetch/pull from remote git server in the future,
1854 # we only want to use git svn for future updates
1855 git config --remove-section remote.origin
1856 # Create a local branch from one of the branches just fetched
1857 git checkout -b master FETCH_HEAD
1858 # Initialize 'git svn' locally (be sure to use the same URL and -T/-b/-t options as were used on server)
1859 git svn init http://svn.example.com/project
1860 # Pull the latest changes from Subversion
1861 git svn rebase</tt></pre>
1862 </div></div>
1863 </div>
1864 <h2 id="_rebase_vs_pull_merge">REBASE VS. PULL/MERGE</h2>
1865 <div class="sectionbody">
1866 <div class="paragraph"><p>Originally, <em>git svn</em> recommended that the <em>remotes/git-svn</em> branch be
1867 pulled or merged from. This is because the author favored
1868 <tt>git svn set-tree B</tt> to commit a single head rather than the
1869 <tt>git svn set-tree A..B</tt> notation to commit multiple commits.</p></div>
1870 <div class="paragraph"><p>If you use <tt>git svn set-tree A..B</tt> to commit several diffs and you do
1871 not have the latest remotes/git-svn merged into my-branch, you should
1872 use <tt>git svn rebase</tt> to update your work branch instead of <tt>git pull</tt> or
1873 <tt>git merge</tt>. <tt>pull</tt>/<tt>merge</tt> can cause non-linear history to be flattened
1874 when committing into SVN, which can lead to merge commits reversing
1875 previous commits in SVN.</p></div>
1876 </div>
1877 <h2 id="_merge_tracking">MERGE TRACKING</h2>
1878 <div class="sectionbody">
1879 <div class="paragraph"><p>While <em>git svn</em> can track
1880 copy history (including branches and tags) for repositories adopting a
1881 standard layout, it cannot yet represent merge history that happened
1882 inside git back upstream to SVN users. Therefore it is advised that
1883 users keep history as linear as possible inside git to ease
1884 compatibility with SVN (see the CAVEATS section below).</p></div>
1885 </div>
1886 <h2 id="_caveats">CAVEATS</h2>
1887 <div class="sectionbody">
1888 <div class="paragraph"><p>For the sake of simplicity and interoperating with Subversion,
1889 it is recommended that all <em>git svn</em> users clone, fetch and dcommit
1890 directly from the SVN server, and avoid all <em>git clone</em>/<em>pull</em>/<em>merge</em>/<em>push</em>
1891 operations between git repositories and branches. The recommended
1892 method of exchanging code between git branches and users is
1893 <em>git format-patch</em> and <em>git am</em>, or just 'dcommit&#8217;ing to the SVN repository.</p></div>
1894 <div class="paragraph"><p>Running <em>git merge</em> or <em>git pull</em> is NOT recommended on a branch you
1895 plan to <em>dcommit</em> from because Subversion users cannot see any
1896 merges you&#8217;ve made. Furthermore, if you merge or pull from a git branch
1897 that is a mirror of an SVN branch, <em>dcommit</em> may commit to the wrong
1898 branch.</p></div>
1899 <div class="paragraph"><p>If you do merge, note the following rule: <em>git svn dcommit</em> will
1900 attempt to commit on top of the SVN commit named in</p></div>
1901 <div class="listingblock">
1902 <div class="content">
1903 <pre><tt>git log --grep=^git-svn-id: --first-parent -1</tt></pre>
1904 </div></div>
1905 <div class="paragraph"><p>You <em>must</em> therefore ensure that the most recent commit of the branch
1906 you want to dcommit to is the <em>first</em> parent of the merge. Chaos will
1907 ensue otherwise, especially if the first parent is an older commit on
1908 the same SVN branch.</p></div>
1909 <div class="paragraph"><p><em>git clone</em> does not clone branches under the refs/remotes/ hierarchy or
1910 any <em>git svn</em> metadata, or config. So repositories created and managed with
1911 using <em>git svn</em> should use <em>rsync</em> for cloning, if cloning is to be done
1912 at all.</p></div>
1913 <div class="paragraph"><p>Since <em>dcommit</em> uses rebase internally, any git branches you <em>git push</em> to
1914 before <em>dcommit</em> on will require forcing an overwrite of the existing ref
1915 on the remote repository. This is generally considered bad practice,
1916 see the <a href="git-push.html">git-push(1)</a> documentation for details.</p></div>
1917 <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
1918 already dcommitted. It is considered bad practice to --amend commits
1919 you&#8217;ve already pushed to a remote repository for other users, and
1920 dcommit with SVN is analogous to that.</p></div>
1921 <div class="paragraph"><p>When using multiple --branches or --tags, <em>git svn</em> does not automatically
1922 handle name collisions (for example, if two branches from different paths have
1923 the same name, or if a branch and a tag have the same name). In these cases,
1924 use <em>init</em> to set up your git repository then, before your first <em>fetch</em>, edit
1925 the .git/config file so that the branches and tags are associated with
1926 different name spaces. For example:</p></div>
1927 <div class="literalblock">
1928 <div class="content">
1929 <pre><tt>branches = stable/*:refs/remotes/svn/stable/*
1930 branches = debug/*:refs/remotes/svn/debug/*</tt></pre>
1931 </div></div>
1932 </div>
1933 <h2 id="_bugs">BUGS</h2>
1934 <div class="sectionbody">
1935 <div class="paragraph"><p>We ignore all SVN properties except svn:executable. Any unhandled
1936 properties are logged to $GIT_DIR/svn/&lt;refname&gt;/unhandled.log</p></div>
1937 <div class="paragraph"><p>Renamed and copied directories are not detected by git and hence not
1938 tracked when committing to SVN. I do not plan on adding support for
1939 this as it&#8217;s quite difficult and time-consuming to get working for all
1940 the possible corner cases (git doesn&#8217;t do it, either). Committing
1941 renamed and copied files is fully supported if they&#8217;re similar enough
1942 for git to detect them.</p></div>
1943 </div>
1944 <h2 id="_configuration">CONFIGURATION</h2>
1945 <div class="sectionbody">
1946 <div class="paragraph"><p><em>git svn</em> stores [svn-remote] configuration information in the
1947 repository .git/config file. It is similar the core git
1948 [remote] sections except <em>fetch</em> keys do not accept glob
1949 arguments; but they are instead handled by the <em>branches</em>
1950 and <em>tags</em> keys. Since some SVN repositories are oddly
1951 configured with multiple projects glob expansions such those
1952 listed below are allowed:</p></div>
1953 <div class="listingblock">
1954 <div class="content">
1955 <pre><tt>[svn-remote "project-a"]
1956 url = http://server.org/svn
1957 fetch = trunk/project-a:refs/remotes/project-a/trunk
1958 branches = branches/*/project-a:refs/remotes/project-a/branches/*
1959 tags = tags/*/project-a:refs/remotes/project-a/tags/*</tt></pre>
1960 </div></div>
1961 <div class="paragraph"><p>Keep in mind that the <em>*</em> (asterisk) wildcard of the local ref
1962 (right of the <em>:</em>) <strong>must</strong> be the farthest right path component;
1963 however the remote wildcard may be anywhere as long as it&#8217;s an
1964 independent path component (surrounded by <em>/</em> or EOL). This
1965 type of configuration is not automatically created by <em>init</em> and
1966 should be manually entered with a text-editor or using <em>git config</em>.</p></div>
1967 <div class="paragraph"><p>It is also possible to fetch a subset of branches or tags by using a
1968 comma-separated list of names within braces. For example:</p></div>
1969 <div class="listingblock">
1970 <div class="content">
1971 <pre><tt>[svn-remote "huge-project"]
1972 url = http://server.org/svn
1973 fetch = trunk/src:refs/remotes/trunk
1974 branches = branches/{red,green}/src:refs/remotes/branches/*
1975 tags = tags/{1.0,2.0}/src:refs/remotes/tags/*</tt></pre>
1976 </div></div>
1977 <div class="paragraph"><p>Note that git-svn keeps track of the highest revision in which a branch
1978 or tag has appeared. If the subset of branches or tags is changed after
1979 fetching, then .git/svn/.metadata must be manually edited to remove (or
1980 reset) branches-maxRev and/or tags-maxRev as appropriate.</p></div>
1981 </div>
1982 <h2 id="_see_also">SEE ALSO</h2>
1983 <div class="sectionbody">
1984 <div class="paragraph"><p><a href="git-rebase.html">git-rebase(1)</a></p></div>
1985 </div>
1986 <h2 id="_git">GIT</h2>
1987 <div class="sectionbody">
1988 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
1989 </div>
1990 </div>
1991 <div id="footnotes"><hr /></div>
1992 <div id="footer">
1993 <div id="footer-text">
1994 Last updated 2011-10-05 13:59:16 PDT
1995 </div>
1996 </div>
1997 </body>
1998 </html>