blob: 9d1b9c37fad171fa85bdb211312af657c52b5e8e [file] [log] [blame]
Junio C Hamano9ae1a062006-07-10 08:12:341<!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" />
Junio C Hamanoba4b9282008-07-06 05:20:316<meta name="generator" content="AsciiDoc 8.2.5" />
Junio C Hamano9ae1a062006-07-10 08:12:347<style type="text/css">
8/* Debug borders */
9p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
10/*
11 border: 1px solid red;
12*/
13}
14
15body {
16 margin: 1em 5% 1em 5%;
17}
18
Junio C Hamanoba4b9282008-07-06 05:20:3119a {
20 color: blue;
21 text-decoration: underline;
22}
23a:visited {
24 color: fuchsia;
25}
Junio C Hamano9ae1a062006-07-10 08:12:3426
27em {
28 font-style: italic;
29}
30
31strong {
32 font-weight: bold;
33}
34
35tt {
36 color: navy;
37}
38
39h1, h2, h3, h4, h5, h6 {
40 color: #527bbd;
41 font-family: sans-serif;
42 margin-top: 1.2em;
43 margin-bottom: 0.5em;
44 line-height: 1.3;
45}
46
Junio C Hamanoba4b9282008-07-06 05:20:3147h1, h2, h3 {
Junio C Hamano9ae1a062006-07-10 08:12:3448 border-bottom: 2px solid silver;
49}
50h2 {
Junio C Hamano9ae1a062006-07-10 08:12:3451 padding-top: 0.5em;
52}
Junio C Hamanoba4b9282008-07-06 05:20:3153h3 {
54 float: left;
55}
56h3 + * {
57 clear: left;
58}
Junio C Hamano9ae1a062006-07-10 08:12:3459
60div.sectionbody {
61 font-family: serif;
62 margin-left: 0;
63}
64
65hr {
66 border: 1px solid silver;
67}
68
69p {
70 margin-top: 0.5em;
71 margin-bottom: 0.5em;
72}
73
74pre {
75 padding: 0;
76 margin: 0;
77}
78
79span#author {
80 color: #527bbd;
81 font-family: sans-serif;
82 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:3183 font-size: 1.1em;
Junio C Hamano9ae1a062006-07-10 08:12:3484}
85span#email {
86}
87span#revision {
88 font-family: sans-serif;
89}
90
91div#footer {
92 font-family: sans-serif;
93 font-size: small;
94 border-top: 2px solid silver;
95 padding-top: 0.5em;
96 margin-top: 4.0em;
97}
98div#footer-text {
99 float: left;
100 padding-bottom: 0.5em;
101}
102div#footer-badges {
103 float: right;
104 padding-bottom: 0.5em;
105}
106
107div#preamble,
108div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
109div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
110div.admonitionblock {
111 margin-right: 10%;
112 margin-top: 1.5em;
113 margin-bottom: 1.5em;
114}
115div.admonitionblock {
116 margin-top: 2.5em;
117 margin-bottom: 2.5em;
118}
119
120div.content { /* Block element content. */
121 padding: 0;
122}
123
124/* Block element titles. */
125div.title, caption.title {
126 font-family: sans-serif;
127 font-weight: bold;
128 text-align: left;
129 margin-top: 1.0em;
130 margin-bottom: 0.5em;
131}
132div.title + * {
133 margin-top: 0;
134}
135
136td div.title:first-child {
137 margin-top: 0.0em;
138}
139div.content div.title:first-child {
140 margin-top: 0.0em;
141}
142div.content + div.title {
143 margin-top: 0.0em;
144}
145
146div.sidebarblock > div.content {
147 background: #ffffee;
148 border: 1px solid silver;
149 padding: 0.5em;
150}
151
Junio C Hamanoba4b9282008-07-06 05:20:31152div.listingblock {
153 margin-right: 0%;
154}
Junio C Hamano9ae1a062006-07-10 08:12:34155div.listingblock > div.content {
156 border: 1px solid silver;
157 background: #f4f4f4;
158 padding: 0.5em;
159}
160
161div.quoteblock > div.content {
162 padding-left: 2.0em;
163}
Junio C Hamanoba4b9282008-07-06 05:20:31164
165div.attribution {
Junio C Hamano9ae1a062006-07-10 08:12:34166 text-align: right;
167}
Junio C Hamanoba4b9282008-07-06 05:20:31168div.verseblock + div.attribution {
169 text-align: left;
170}
Junio C Hamano9ae1a062006-07-10 08:12:34171
172div.admonitionblock .icon {
173 vertical-align: top;
174 font-size: 1.1em;
175 font-weight: bold;
176 text-decoration: underline;
177 color: #527bbd;
178 padding-right: 0.5em;
179}
180div.admonitionblock td.content {
181 padding-left: 0.5em;
182 border-left: 2px solid silver;
183}
184
185div.exampleblock > div.content {
186 border-left: 2px solid silver;
187 padding: 0.5em;
188}
189
190div.verseblock div.content {
191 white-space: pre;
192}
193
194div.imageblock div.content { padding-left: 0; }
195div.imageblock img { border: 1px solid silver; }
196span.image img { border-style: none; }
197
198dl {
199 margin-top: 0.8em;
200 margin-bottom: 0.8em;
201}
202dt {
203 margin-top: 0.5em;
204 margin-bottom: 0;
205 font-style: italic;
206}
207dd > *:first-child {
208 margin-top: 0;
209}
210
211ul, ol {
212 list-style-position: outside;
213}
Junio C Hamanoba4b9282008-07-06 05:20:31214div.olist2 ol {
Junio C Hamano9ae1a062006-07-10 08:12:34215 list-style-type: lower-alpha;
216}
217
218div.tableblock > table {
Junio C Hamanoba4b9282008-07-06 05:20:31219 border: 3px solid #527bbd;
Junio C Hamano9ae1a062006-07-10 08:12:34220}
221thead {
222 font-family: sans-serif;
223 font-weight: bold;
224}
225tfoot {
226 font-weight: bold;
227}
228
229div.hlist {
230 margin-top: 0.8em;
231 margin-bottom: 0.8em;
232}
Junio C Hamanoba4b9282008-07-06 05:20:31233div.hlist td {
234 padding-bottom: 5px;
235}
Junio C Hamano9ae1a062006-07-10 08:12:34236td.hlist1 {
237 vertical-align: top;
238 font-style: italic;
239 padding-right: 0.8em;
240}
241td.hlist2 {
242 vertical-align: top;
243}
244
245@media print {
246 div#footer-badges { display: none; }
247}
Junio C Hamanoba4b9282008-07-06 05:20:31248
249div#toctitle {
250 color: #527bbd;
251 font-family: sans-serif;
252 font-size: 1.1em;
253 font-weight: bold;
254 margin-top: 1.0em;
255 margin-bottom: 0.1em;
256}
257
258div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
259 margin-top: 0;
260 margin-bottom: 0;
261}
262div.toclevel2 {
263 margin-left: 2em;
264 font-size: 0.9em;
265}
266div.toclevel3 {
267 margin-left: 4em;
268 font-size: 0.9em;
269}
270div.toclevel4 {
271 margin-left: 6em;
272 font-size: 0.9em;
273}
274include1::./stylesheets/xhtml11-manpage.css[]
Junio C Hamano9ae1a062006-07-10 08:12:34275/* Workarounds for IE6's broken and incomplete CSS2. */
276
277div.sidebar-content {
278 background: #ffffee;
279 border: 1px solid silver;
280 padding: 0.5em;
281}
282div.sidebar-title, div.image-title {
283 font-family: sans-serif;
284 font-weight: bold;
285 margin-top: 0.0em;
286 margin-bottom: 0.5em;
287}
288
289div.listingblock div.content {
290 border: 1px solid silver;
291 background: #f4f4f4;
292 padding: 0.5em;
293}
294
295div.quoteblock-content {
296 padding-left: 2.0em;
297}
298
299div.exampleblock-content {
300 border-left: 2px solid silver;
301 padding-left: 0.5em;
302}
Junio C Hamanoba4b9282008-07-06 05:20:31303
304/* IE6 sets dynamically generated links as visited. */
305div#toc a:visited { color: blue; }
Junio C Hamano9ae1a062006-07-10 08:12:34306</style>
307<title>git-svn(1)</title>
308</head>
309<body>
310<div id="header">
311<h1>
312git-svn(1) Manual Page
313</h1>
314<h2>NAME</h2>
315<div class="sectionbody">
316<p>git-svn -
Junio C Hamano688eae02009-06-28 05:19:50317 Bidirectional operation between a Subversion repository and git
Junio C Hamano9ae1a062006-07-10 08:12:34318</p>
319</div>
320</div>
321<h2>SYNOPSIS</h2>
322<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31323<div class="para"><p><em>git svn</em> &lt;command&gt; [options] [arguments]</p></div>
Junio C Hamano9ae1a062006-07-10 08:12:34324</div>
Junio C Hamanoba4b9282008-07-06 05:20:31325<h2 id="_description">DESCRIPTION</h2>
Junio C Hamano9ae1a062006-07-10 08:12:34326<div class="sectionbody">
Junio C Hamano48bc1ce2009-07-09 16:49:19327<div class="para"><p><em>git svn</em> is a simple conduit for changesets between Subversion and git.
Junio C Hamano7f80ae82008-07-30 18:31:35328It provides a bidirectional flow of changes between a Subversion and a git
Junio C Hamanocb1c44f2008-08-06 06:19:33329repository.</p></div>
Junio C Hamano48bc1ce2009-07-09 16:49:19330<div class="para"><p><em>git svn</em> can track a standard Subversion repository,
Junio C Hamano688eae02009-06-28 05:19:50331following the common "trunk/branches/tags" layout, with the --stdlayout option.
332It can also follow branches and tags in any layout with the -T/-t/-b options
333(see options to <em>init</em> below, and also the <em>clone</em> command).</p></div>
334<div class="para"><p>Once tracking a Subversion repository (with any of the above methods), the git
Junio C Hamano7f80ae82008-07-30 18:31:35335repository can be updated from Subversion by the <em>fetch</em> command and
336Subversion updated from git by the <em>dcommit</em> command.</p></div>
Junio C Hamano9ae1a062006-07-10 08:12:34337</div>
Junio C Hamanoba4b9282008-07-06 05:20:31338<h2 id="_commands">COMMANDS</h2>
Junio C Hamano9ae1a062006-07-10 08:12:34339<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31340<div class="vlist"><dl>
Junio C Hamano9ae1a062006-07-10 08:12:34341<dt>
Junio C Hamano6b2cee12006-08-26 08:43:31342<em>init</em>
Junio C Hamano9ae1a062006-07-10 08:12:34343</dt>
344<dd>
345<p>
Junio C Hamano00cb3712007-02-23 11:13:52346 Initializes an empty git repository with additional
Junio C Hamano48bc1ce2009-07-09 16:49:19347 metadata directories for <em>git svn</em>. The Subversion URL
Junio C Hamano00cb3712007-02-23 11:13:52348 may be specified as a command-line argument, or as full
349 URL arguments to -T/-t/-b. Optionally, the target
350 directory to operate on can be specified as a second
351 argument. Normally this command initializes the current
352 directory.
Junio C Hamano9ae1a062006-07-10 08:12:34353</p>
Junio C Hamanoba4b9282008-07-06 05:20:31354<div class="vlist"><dl>
Junio C Hamano9ae1a062006-07-10 08:12:34355<dt>
Junio C Hamano00cb3712007-02-23 11:13:52356-T&lt;trunk_subdir&gt;
357</dt>
358<dt>
359--trunk=&lt;trunk_subdir&gt;
360</dt>
361<dt>
362-t&lt;tags_subdir&gt;
363</dt>
364<dt>
365--tags=&lt;tags_subdir&gt;
366</dt>
367<dt>
368-b&lt;branches_subdir&gt;
369</dt>
370<dt>
371--branches=&lt;branches_subdir&gt;
372</dt>
Junio C Hamano377018d2007-08-23 08:41:31373<dt>
374-s
375</dt>
376<dt>
377--stdlayout
378</dt>
Junio C Hamano00cb3712007-02-23 11:13:52379<dd>
380<p>
381 These are optional command-line options for init. Each of
382 these flags can point to a relative repository path
Junio C Hamano688eae02009-06-28 05:19:50383 (--tags=project/tags) or a full url
384 (--tags=https://foo.org/project/tags).
385 You can specify more than one --tags and/or --branches options, in case
386 your Subversion repository places tags or branches under multiple paths.
387 The option --stdlayout is
Junio C Hamano377018d2007-08-23 08:41:31388 a shorthand way of setting trunk,tags,branches as the relative paths,
389 which is the Subversion default. If any of the other options are given
390 as well, they take precedence.
Junio C Hamano00cb3712007-02-23 11:13:52391</p>
392</dd>
393<dt>
394--no-metadata
395</dt>
396<dd>
397<p>
398 Set the <em>noMetadata</em> option in the [svn-remote] config.
399</p>
400</dd>
401<dt>
402--use-svm-props
403</dt>
404<dd>
405<p>
406 Set the <em>useSvmProps</em> option in the [svn-remote] config.
407</p>
408</dd>
409<dt>
410--use-svnsync-props
411</dt>
412<dd>
413<p>
414 Set the <em>useSvnsyncProps</em> option in the [svn-remote] config.
415</p>
416</dd>
417<dt>
418--rewrite-root=&lt;URL&gt;
419</dt>
420<dd>
421<p>
422 Set the <em>rewriteRoot</em> option in the [svn-remote] config.
423</p>
424</dd>
425<dt>
Junio C Hamanod0d892c2010-01-24 20:06:29426--rewrite-uuid=&lt;UUID&gt;
427</dt>
428<dd>
429<p>
430 Set the <em>rewriteUUID</em> option in the [svn-remote] config.
431</p>
432</dd>
433<dt>
Junio C Hamano00cb3712007-02-23 11:13:52434--username=&lt;USER&gt;
435</dt>
436<dd>
437<p>
438 For transports that SVN handles authentication for (http,
439 https, and plain svn), specify the username. For other
440 transports (eg svn+ssh://), you must include the username in
441 the URL, eg svn+ssh://foo@svn.bar.com/project
442</p>
Junio C Hamanoa3fd83c2007-03-02 10:34:36443</dd>
444<dt>
445--prefix=&lt;prefix&gt;
446</dt>
447<dd>
448<p>
Junio C Hamano00cb3712007-02-23 11:13:52449 This allows one to specify a prefix which is prepended
450 to the names of remotes if trunk/branches/tags are
451 specified. The prefix does not automatically include a
452 trailing slash, so be sure you include one in the
Junio C Hamano0a2ad892007-06-24 22:23:12453 argument if that is what you want. If --branches/-b is
454 specified, the prefix must include a trailing slash.
455 Setting a prefix is useful if you wish to track multiple
456 projects that share a common repository.
Junio C Hamanoa3fd83c2007-03-02 10:34:36457</p>
Junio C Hamano00cb3712007-02-23 11:13:52458</dd>
Junio C Hamano55344412009-04-12 18:31:19459<dt>
460--ignore-paths=&lt;regex&gt;
461</dt>
462<dd>
463<p>
464 When passed to <em>init</em> or <em>clone</em> this regular expression will
465 be preserved as a config key. See <em>fetch</em> for a description
466 of <em>--ignore-paths</em>.
467</p>
468</dd>
Junio C Hamanoaa2cd762009-07-26 08:14:01469<dt>
470--no-minimize-url
471</dt>
472<dd>
473<p>
474 When tracking multiple directories (using --stdlayout,
475 --branches, or --tags options), git svn will attempt to connect
476 to the root (or highest allowed level) of the Subversion
477 repository. This default allows better tracking of history if
478 entire projects are moved within a repository, but may cause
479 issues on repositories where read access restrictions are in
480 place. Passing <em>--no-minimize-url</em> will allow git svn to
481 accept URLs as-is without attempting to connect to a higher
482 level directory. This option is off by default when only
483 one URL/branch is tracked (it would do little good).
484</p>
485</dd>
Junio C Hamanoba4b9282008-07-06 05:20:31486</dl></div>
Junio C Hamano67fad6d2007-05-06 08:53:12487</dd>
Junio C Hamano00cb3712007-02-23 11:13:52488<dt>
Junio C Hamano6b2cee12006-08-26 08:43:31489<em>fetch</em>
Junio C Hamano9ae1a062006-07-10 08:12:34490</dt>
491<dd>
492<p>
Junio C Hamano00cb3712007-02-23 11:13:52493 Fetch unfetched revisions from the Subversion remote we are
494 tracking. The name of the [svn-remote "&#8230;"] section in the
495 .git/config file may be specified as an optional command-line
496 argument.
Junio C Hamano9ae1a062006-07-10 08:12:34497</p>
Junio C Hamano8f4ac0d2009-01-19 08:35:36498<div class="vlist"><dl>
499<dt>
500--localtime
501</dt>
502<dd>
503<p>
504 Store Git commit times in the local timezone instead of UTC. This
Junio C Hamano48bc1ce2009-07-09 16:49:19505 makes <em>git log</em> (even without --date=local) show the same times
Junio C Hamano8f4ac0d2009-01-19 08:35:36506 that <tt>svn log</tt> would in the local timezone.
507</p>
Junio C Hamano0df868a2009-08-19 07:28:28508<div class="para"><p>This doesn't interfere with interoperating with the Subversion
509repository you cloned from, but if you wish for your local Git
510repository to be able to interoperate with someone else's local Git
511repository, either don't use this option or you should both use it in
512the same local timezone.</p></div>
Junio C Hamano55344412009-04-12 18:31:19513</dd>
514<dt>
515--parent
516</dt>
517<dd>
518<p>
519 Fetch only from the SVN parent of the current HEAD.
520</p>
Junio C Hamano8f4ac0d2009-01-19 08:35:36521</dd>
Junio C Hamanoa07e8162009-01-26 17:36:43522<dt>
523--ignore-paths=&lt;regex&gt;
524</dt>
525<dd>
526<p>
Junio C Hamano55344412009-04-12 18:31:19527 This allows one to specify a Perl regular expression that will
Junio C Hamanoa07e8162009-01-26 17:36:43528 cause skipping of all matching paths from checkout from SVN.
Junio C Hamano55344412009-04-12 18:31:19529 The <em>--ignore-paths</em> option should match for every <em>fetch</em>
530 (including automatic fetches due to <em>clone</em>, <em>dcommit</em>,
531 <em>rebase</em>, etc) on a given repository.
Junio C Hamanoa07e8162009-01-26 17:36:43532</p>
Junio C Hamano48bc1ce2009-07-09 16:49:19533<div class="verseblock">
534<div class="content">config key: svn-remote.&lt;name&gt;.ignore-paths</div></div>
535<div class="para"><p>If the ignore-paths config key is set and the command line option is
536also given, both regular expressions will be used.</p></div>
Junio C Hamano55344412009-04-12 18:31:19537<div class="para"><p>Examples:</p></div>
Junio C Hamano48bc1ce2009-07-09 16:49:19538<div class="vlist"><dl>
539<dt>
540Skip "doc*" directory for every fetch
541</dt>
542<dd>
543<p>
544+
545</p>
546<div class="listingblock">
Junio C Hamano55344412009-04-12 18:31:19547<div class="content">
Junio C Hamano48bc1ce2009-07-09 16:49:19548<pre><tt>--ignore-paths="^doc"</tt></pre>
Junio C Hamanoa07e8162009-01-26 17:36:43549</div></div>
Junio C Hamano48bc1ce2009-07-09 16:49:19550</dd>
551<dt>
552Skip "branches" and "tags" of first level directories
553</dt>
554<dd>
555<p>
556+
557</p>
558<div class="listingblock">
Junio C Hamanoa07e8162009-01-26 17:36:43559<div class="content">
Junio C Hamano48bc1ce2009-07-09 16:49:19560<pre><tt>--ignore-paths="^[^/]+/(?:branches|tags)"</tt></pre>
Junio C Hamanoa07e8162009-01-26 17:36:43561</div></div>
562</dd>
Junio C Hamano8f4ac0d2009-01-19 08:35:36563</dl></div>
Junio C Hamano00cb3712007-02-23 11:13:52564</dd>
565<dt>
Junio C Hamano48bc1ce2009-07-09 16:49:19566--use-log-author
567</dt>
568<dd>
569<p>
570 When retrieving svn commits into git (as part of fetch, rebase, or
571 dcommit operations), look for the first From: or Signed-off-by: line
572 in the log message and use that as the author string.
573</p>
574</dd>
575<dt>
576--add-author-from
577</dt>
578<dd>
579<p>
580 When committing to svn from git (as part of commit or dcommit
581 operations), if the existing log message doesn't already have a
582 From: or Signed-off-by: line, append a From: line based on the
583 git commit's author string. If you use this, then --use-log-author
584 will retrieve a valid author string for all commits.
585</p>
586</dd>
587</dl></div>
588</dd>
589<dt>
Junio C Hamano00cb3712007-02-23 11:13:52590<em>clone</em>
591</dt>
592<dd>
593<p>
594 Runs <em>init</em> and <em>fetch</em>. It will automatically create a
595 directory based on the basename of the URL passed to it;
596 or if a second argument is passed; it will create a directory
597 and work within that. It accepts all arguments that the
598 <em>init</em> and <em>fetch</em> commands accept; with the exception of
Junio C Hamano48bc1ce2009-07-09 16:49:19599 <em>--fetch-all</em> and <em>--parent</em>. After a repository is cloned,
600 the <em>fetch</em> command will be able to update revisions without
601 affecting the working tree; and the <em>rebase</em> command will be
602 able to update the working tree with the latest changes.
Junio C Hamano00cb3712007-02-23 11:13:52603</p>
604</dd>
605<dt>
606<em>rebase</em>
607</dt>
608<dd>
609<p>
610 This fetches revisions from the SVN parent of the current HEAD
611 and rebases the current (uncommitted to SVN) work against it.
612</p>
Junio C Hamano48bc1ce2009-07-09 16:49:19613<div class="para"><p>This works similarly to <tt>svn update</tt> or <em>git pull</em> except that
614it preserves linear history with <em>git rebase</em> instead of
615<em>git merge</em> for ease of dcommitting with <em>git svn</em>.</p></div>
616<div class="para"><p>This accepts all options that <em>git svn fetch</em> and <em>git rebase</em>
Junio C Hamanofce7c7e2008-07-02 03:06:38617accept. However, <em>--fetch-all</em> only fetches from the current
Junio C Hamanoba4b9282008-07-06 05:20:31618[svn-remote], and not all [svn-remote] definitions.</p></div>
Junio C Hamano48bc1ce2009-07-09 16:49:19619<div class="para"><p>Like <em>git rebase</em>; this requires that the working tree be clean
Junio C Hamanoba4b9282008-07-06 05:20:31620and have no uncommitted changes.</p></div>
621<div class="vlist"><dl>
Junio C Hamano103ad7f2007-03-14 11:19:26622<dt>
623-l
624</dt>
625<dt>
626--local
627</dt>
628<dd>
629<p>
Junio C Hamano48bc1ce2009-07-09 16:49:19630 Do not fetch remotely; only run <em>git rebase</em> against the
Junio C Hamano103ad7f2007-03-14 11:19:26631 last fetched commit from the upstream SVN.
632</p>
633</dd>
Junio C Hamanoba4b9282008-07-06 05:20:31634</dl></div>
Junio C Hamano67fad6d2007-05-06 08:53:12635</dd>
Junio C Hamano9ae1a062006-07-10 08:12:34636<dt>
Junio C Hamano6b2cee12006-08-26 08:43:31637<em>dcommit</em>
638</dt>
639<dd>
640<p>
Junio C Hamano79770b62007-01-07 07:43:58641 Commit each diff from a specified head directly to the SVN
Junio C Hamano6b2cee12006-08-26 08:43:31642 repository, and then rebase or reset (depending on whether or
Junio C Hamano79770b62007-01-07 07:43:58643 not there is a diff between SVN and head). This will create
644 a revision in SVN for each commit in git.
Junio C Hamano48bc1ce2009-07-09 16:49:19645 It is recommended that you run <em>git svn</em> fetch and rebase (not
Junio C Hamano79770b62007-01-07 07:43:58646 pull or merge) your commits against the latest changes in the
647 SVN repository.
Junio C Hamano688eae02009-06-28 05:19:50648 An optional revision or branch argument may be specified, and
Junio C Hamano48bc1ce2009-07-09 16:49:19649 causes <em>git svn</em> to do all work on that revision/branch
Junio C Hamano688eae02009-06-28 05:19:50650 instead of HEAD.
Junio C Hamano4bf6dca2006-12-21 02:25:57651 This is advantageous over <em>set-tree</em> (below) because it produces
Junio C Hamano48bc1ce2009-07-09 16:49:19652 cleaner, more linear history.
Junio C Hamano6b2cee12006-08-26 08:43:31653</p>
Junio C Hamanoba4b9282008-07-06 05:20:31654<div class="vlist"><dl>
Junio C Hamano67fad6d2007-05-06 08:53:12655<dt>
656--no-rebase
657</dt>
658<dd>
659<p>
660 After committing, do not rebase or reset.
661</p>
662</dd>
Junio C Hamanofaa1e502008-08-10 03:55:58663<dt>
664--commit-url &lt;URL&gt;
665</dt>
666<dd>
667<p>
668 Commit to this SVN URL (the full path). This is intended to
Junio C Hamano48bc1ce2009-07-09 16:49:19669 allow existing <em>git svn</em> repositories created with one transport
Junio C Hamanofaa1e502008-08-10 03:55:58670 method (e.g. <tt>svn://</tt> or <tt>http://</tt> for anonymous read) to be
671 reused if a user is later given access to an alternate transport
672 method (e.g. <tt>svn+ssh://</tt> or <tt>https://</tt>) for commit.
673</p>
Junio C Hamano48bc1ce2009-07-09 16:49:19674<div class="verseblock">
675<div class="content">config key: svn-remote.&lt;name&gt;.commiturl
676config key: svn.commiturl (overwrites all svn-remote.&lt;name&gt;.commiturl options)</div></div>
677<div class="para"><p>Using this option for any other purpose (don't ask) is very strongly
678discouraged.</p></div>
Junio C Hamanofaa1e502008-08-10 03:55:58679</dd>
Junio C Hamanoba4b9282008-07-06 05:20:31680</dl></div>
Junio C Hamano6b2cee12006-08-26 08:43:31681</dd>
682<dt>
Junio C Hamanoa476efa2008-10-10 15:31:42683<em>branch</em>
684</dt>
685<dd>
686<p>
687 Create a branch in the SVN repository.
688</p>
689<div class="vlist"><dl>
690<dt>
691-m
692</dt>
693<dt>
694--message
695</dt>
696<dd>
697<p>
698 Allows to specify the commit message.
699</p>
700</dd>
701<dt>
702-t
703</dt>
704<dt>
705--tag
706</dt>
707<dd>
708<p>
709 Create a tag by using the tags_subdir instead of the branches_subdir
710 specified during git svn init.
711</p>
712</dd>
Junio C Hamano688eae02009-06-28 05:19:50713<dt>
714-d
715</dt>
716<dt>
717--destination
718</dt>
719<dd>
720<p>
721 If more than one --branches (or --tags) option was given to the <em>init</em>
722 or <em>clone</em> command, you must provide the location of the branch (or
723 tag) you wish to create in the SVN repository. The value of this
724 option must match one of the paths specified by a --branches (or
725 --tags) option. You can see these paths with the commands
726</p>
727<div class="literalblock">
728<div class="content">
729<pre><tt>git config --get-all svn-remote.&lt;name&gt;.branches
730git config --get-all svn-remote.&lt;name&gt;.tags</tt></pre>
731</div></div>
732<div class="para"><p>where &lt;name&gt; is the name of the SVN repository as specified by the -R option to
733<em>init</em> (or "svn" by default).</p></div>
734</dd>
Junio C Hamanod0d892c2010-01-24 20:06:29735<dt>
736--username
737</dt>
738<dd>
739<p>
740 Specify the SVN username to perform the commit as. This option overrides
741 configuration property <em>username</em>.
742</p>
743</dd>
744<dt>
745--commit-url
746</dt>
747<dd>
748<p>
749 Use the specified URL to connect to the destination Subversion
750 repository. This is useful in cases where the source SVN
751 repository is read-only. This option overrides configuration
752 property <em>commiturl</em>.
753</p>
754<div class="literalblock">
755<div class="content">
756<pre><tt>git config --get-all svn-remote.&lt;name&gt;.commiturl</tt></pre>
757</div></div>
758</dd>
Junio C Hamanoa476efa2008-10-10 15:31:42759</dl></div>
760</dd>
761<dt>
762<em>tag</em>
763</dt>
764<dd>
765<p>
766 Create a tag in the SVN repository. This is a shorthand for
767 <em>branch -t</em>.
768</p>
769</dd>
770<dt>
Junio C Hamano43d01342006-10-12 04:07:32771<em>log</em>
772</dt>
773<dd>
774<p>
775 This should make it easy to look up svn log messages when svn
776 users refer to -r/--revision numbers.
777</p>
Junio C Hamanoba4b9282008-07-06 05:20:31778<div class="para"><p>The following features from `svn log' are supported:</p></div>
779<div class="vlist"><dl>
Junio C Hamanoa3fd83c2007-03-02 10:34:36780<dt>
Junio C Hamano48bc1ce2009-07-09 16:49:19781-r &lt;n&gt;[:&lt;n&gt;]
782</dt>
783<dt>
784--revision=&lt;n&gt;[:&lt;n&gt;]
Junio C Hamanoa3fd83c2007-03-02 10:34:36785</dt>
786<dd>
787<p>
788 is supported, non-numeric args are not:
789 HEAD, NEXT, BASE, PREV, etc &#8230;
790</p>
Junio C Hamano43d01342006-10-12 04:07:32791</dd>
792<dt>
Junio C Hamano48bc1ce2009-07-09 16:49:19793-v
794</dt>
795<dt>
796--verbose
Junio C Hamanoa3fd83c2007-03-02 10:34:36797</dt>
798<dd>
799<p>
800 it's not completely compatible with the --verbose
801 output in svn log, but reasonably close.
802</p>
803</dd>
804<dt>
805--limit=&lt;n&gt;
806</dt>
807<dd>
808<p>
809 is NOT the same as --max-count, doesn't count
810 merged/excluded commits
811</p>
812</dd>
813<dt>
814--incremental
815</dt>
816<dd>
817<p>
818 supported
819</p>
820</dd>
Junio C Hamanoba4b9282008-07-06 05:20:31821</dl></div>
822<div class="para"><p>New features:</p></div>
823<div class="vlist"><dl>
Junio C Hamanoa3fd83c2007-03-02 10:34:36824<dt>
825--show-commit
826</dt>
827<dd>
828<p>
829 shows the git commit sha1, as well
830</p>
831</dd>
832<dt>
833--oneline
834</dt>
835<dd>
836<p>
837 our version of --pretty=oneline
838</p>
839</dd>
Junio C Hamanoba4b9282008-07-06 05:20:31840</dl></div>
Junio C Hamano24bc09a2008-02-28 00:27:44841<div class="admonitionblock">
842<table><tr>
843<td class="icon">
844<div class="title">Note</div>
845</td>
846<td class="content">SVN itself only stores times in UTC and nothing else. The regular svn
847client converts the UTC time to the local time (or based on the TZ=
848environment). This command has the same behaviour.</td>
849</tr></table>
850</div>
Junio C Hamano48bc1ce2009-07-09 16:49:19851<div class="para"><p>Any other arguments are passed directly to <em>git log</em></p></div>
Junio C Hamanoa3fd83c2007-03-02 10:34:36852</dd>
Junio C Hamano9c334152008-02-12 03:18:52853<dt>
854<em>blame</em>
855</dt>
856<dd>
857<p>
Junio C Hamano869bb802008-05-12 00:29:47858 Show what revision and author last modified each line of a file. The
859 output of this mode is format-compatible with the output of
Junio C Hamanoba4b9282008-07-06 05:20:31860 `svn blame' by default. Like the SVN blame command,
Junio C Hamano869bb802008-05-12 00:29:47861 local uncommitted changes in the working copy are ignored;
862 the version of the file in the HEAD revision is annotated. Unknown
Junio C Hamano48bc1ce2009-07-09 16:49:19863 arguments are passed directly to <em>git blame</em>.
Junio C Hamano9c334152008-02-12 03:18:52864</p>
Junio C Hamanoba4b9282008-07-06 05:20:31865<div class="vlist"><dl>
Junio C Hamano869bb802008-05-12 00:29:47866<dt>
867--git-format
868</dt>
869<dd>
870<p>
Junio C Hamano48bc1ce2009-07-09 16:49:19871 Produce output in the same format as <em>git blame</em>, but with
Junio C Hamano869bb802008-05-12 00:29:47872 SVN revision numbers instead of git commit hashes. In this mode,
873 changes that haven't been committed to SVN (including local
874 working-copy edits) are shown as revision 0.
875</p>
876</dd>
Junio C Hamanoba4b9282008-07-06 05:20:31877</dl></div>
Junio C Hamano9c334152008-02-12 03:18:52878</dd>
Junio C Hamanoa3fd83c2007-03-02 10:34:36879<dt>
Junio C Hamano469d60e2007-04-29 18:30:34880<em>find-rev</em>
881</dt>
882<dd>
883<p>
884 When given an SVN revision number of the form <em>rN</em>, returns the
Junio C Hamanob63afff2007-05-01 03:05:55885 corresponding git commit hash (this can optionally be followed by a
886 tree-ish to specify which branch should be searched). When given a
887 tree-ish, returns the corresponding SVN revision number.
Junio C Hamano469d60e2007-04-29 18:30:34888</p>
889</dd>
890<dt>
Junio C Hamano4bf6dca2006-12-21 02:25:57891<em>set-tree</em>
Junio C Hamano9ae1a062006-07-10 08:12:34892</dt>
893<dd>
894<p>
Junio C Hamano43d01342006-10-12 04:07:32895 You should consider using <em>dcommit</em> instead of this command.
Junio C Hamano9ae1a062006-07-10 08:12:34896 Commit specified commit or tree objects to SVN. This relies on
897 your imported fetch data being up-to-date. This makes
898 absolutely no attempts to do patching when committing to SVN, it
899 simply overwrites files with those specified in the tree or
900 commit. All merging is assumed to have taken place
Junio C Hamano48bc1ce2009-07-09 16:49:19901 independently of <em>git svn</em> functions.
Junio C Hamano9ae1a062006-07-10 08:12:34902</p>
903</dd>
904<dt>
Junio C Hamano47d68a52008-05-06 06:35:40905<em>create-ignore</em>
906</dt>
907<dd>
908<p>
909 Recursively finds the svn:ignore property on directories and
910 creates matching .gitignore files. The resulting files are staged to
Junio C Hamanofeeb1be2008-05-22 00:53:35911 be committed, but are not committed. Use -r/--revision to refer to a
Junio C Hamanocb1c44f2008-08-06 06:19:33912 specific revision.
Junio C Hamano47d68a52008-05-06 06:35:40913</p>
914</dd>
915<dt>
Junio C Hamano6b2cee12006-08-26 08:43:31916<em>show-ignore</em>
Junio C Hamano9ae1a062006-07-10 08:12:34917</dt>
918<dd>
919<p>
920 Recursively finds and lists the svn:ignore property on
921 directories. The output is suitable for appending to
922 the $GIT_DIR/info/exclude file.
923</p>
924</dd>
Junio C Hamano43d01342006-10-12 04:07:32925<dt>
Junio C Hamanoa5574462009-11-18 07:39:28926<em>mkdirs</em>
927</dt>
928<dd>
929<p>
930 Attempts to recreate empty directories that core git cannot track
931 based on information in $GIT_DIR/svn/&lt;refname&gt;/unhandled.log files.
932 Empty directories are automatically recreated when using
933 "git svn clone" and "git svn rebase", so "mkdirs" is intended
934 for use after commands like "git checkout" or "git reset".
935</p>
936</dd>
937<dt>
Junio C Hamano43d01342006-10-12 04:07:32938<em>commit-diff</em>
939</dt>
940<dd>
941<p>
942 Commits the diff of two tree-ish arguments from the
Junio C Hamano48bc1ce2009-07-09 16:49:19943 command-line. This command does not rely on being inside an <tt>git svn
Junio C Hamanofce7c7e2008-07-02 03:06:38944 init</tt>-ed repository. This command takes three arguments, (a) the
Junio C Hamano43d01342006-10-12 04:07:32945 original tree to diff against, (b) the new tree result, (c) the
946 URL of the target Subversion repository. The final argument
Junio C Hamano48bc1ce2009-07-09 16:49:19947 (URL) may be omitted if you are working from a <em>git svn</em>-aware
948 repository (that has been <tt>init</tt>-ed with <em>git svn</em>).
Junio C Hamano23db8852006-11-09 23:35:53949 The -r&lt;revision&gt; option is required for this.
Junio C Hamano43d01342006-10-12 04:07:32950</p>
951</dd>
Junio C Hamanoa0970542007-11-23 08:43:30952<dt>
953<em>info</em>
954</dt>
955<dd>
956<p>
957 Shows information about a file or directory similar to what
958 `svn info' provides. Does not currently support a -r/--revision
959 argument. Use the --url option to output only the value of the
960 <em>URL:</em> field.
961</p>
962</dd>
Junio C Hamanofeeb1be2008-05-22 00:53:35963<dt>
964<em>proplist</em>
965</dt>
966<dd>
967<p>
968 Lists the properties stored in the Subversion repository about a
969 given file or directory. Use -r/--revision to refer to a specific
970 Subversion revision.
971</p>
972</dd>
973<dt>
974<em>propget</em>
975</dt>
976<dd>
977<p>
978 Gets the Subversion property given as the first argument, for a
979 file. A specific revision can be specified with -r/--revision.
980</p>
981</dd>
982<dt>
983<em>show-externals</em>
984</dt>
985<dd>
986<p>
987 Shows the Subversion externals. Use -r/--revision to specify a
988 specific revision.
989</p>
990</dd>
Junio C Hamano688eae02009-06-28 05:19:50991<dt>
Junio C Hamanoaa2cd762009-07-26 08:14:01992<em>gc</em>
993</dt>
994<dd>
995<p>
996 Compress $GIT_DIR/svn/&lt;refname&gt;/unhandled.log files in .git/svn
997 and remove $GIT_DIR/svn/&lt;refname&gt;index files in .git/svn.
998</p>
999</dd>
1000<dt>
Junio C Hamano688eae02009-06-28 05:19:501001<em>reset</em>
1002</dt>
1003<dd>
1004<p>
1005 Undoes the effects of <em>fetch</em> back to the specified revision.
1006 This allows you to re-<em>fetch</em> an SVN revision. Normally the
1007 contents of an SVN revision should never change and <em>reset</em>
1008 should not be necessary. However, if SVN permissions change,
1009 or if you alter your --ignore-paths option, a <em>fetch</em> may fail
1010 with "not found in commit" (file not previously visible) or
1011 "checksum mismatch" (missed a modification). If the problem
1012 file cannot be ignored forever (with --ignore-paths) the only
1013 way to repair the repo is to use <em>reset</em>.
1014</p>
1015<div class="para"><p>Only the rev_map and refs/remotes/git-svn are changed. Follow <em>reset</em>
Junio C Hamano48bc1ce2009-07-09 16:49:191016with a <em>fetch</em> and then <em>git reset</em> or <em>git rebase</em> to move local
Junio C Hamano688eae02009-06-28 05:19:501017branches onto the new tree.</p></div>
1018<div class="vlist"><dl>
1019<dt>
Junio C Hamano48bc1ce2009-07-09 16:49:191020-r &lt;n&gt;
1021</dt>
1022<dt>
1023--revision=&lt;n&gt;
Junio C Hamano688eae02009-06-28 05:19:501024</dt>
1025<dd>
1026<p>
1027 Specify the most recent revision to keep. All later revisions
1028 are discarded.
1029</p>
1030</dd>
1031<dt>
Junio C Hamano48bc1ce2009-07-09 16:49:191032-p
1033</dt>
1034<dt>
1035--parent
Junio C Hamano688eae02009-06-28 05:19:501036</dt>
1037<dd>
1038<p>
1039 Discard the specified revision as well, keeping the nearest
1040 parent instead.
1041</p>
1042</dd>
1043<dt>
1044Example:
1045</dt>
1046<dd>
1047<p>
1048Assume you have local changes in "master", but you need to refetch "r2".
1049</p>
1050<div class="listingblock">
1051<div class="content">
1052<pre><tt> r1---r2---r3 remotes/git-svn
1053 \
1054 A---B master</tt></pre>
1055</div></div>
1056<div class="para"><p>Fix the ignore-paths or SVN permissions problem that caused "r2" to
1057be incomplete in the first place. Then:</p></div>
1058<div class="verseblock">
1059<div class="content">git svn reset -r2 -p
1060git svn fetch</div></div>
1061<div class="listingblock">
1062<div class="content">
1063<pre><tt> r1---r2'--r3' remotes/git-svn
1064 \
1065 r2---r3---A---B master</tt></pre>
1066</div></div>
Junio C Hamano48bc1ce2009-07-09 16:49:191067<div class="para"><p>Then fixup "master" with <em>git rebase</em>.
1068Do NOT use <em>git merge</em> or your history will not be compatible with a
Junio C Hamano688eae02009-06-28 05:19:501069future <em>dcommit</em>!</p></div>
1070<div class="verseblock">
1071<div class="content">git rebase --onto remotes/git-svn A^ master</div></div>
1072<div class="listingblock">
1073<div class="content">
1074<pre><tt> r1---r2'--r3' remotes/git-svn
1075 \
1076 A'--B' master</tt></pre>
1077</div></div>
1078</dd>
1079</dl></div>
1080</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311081</dl></div>
Junio C Hamano9ae1a062006-07-10 08:12:341082</div>
Junio C Hamanoba4b9282008-07-06 05:20:311083<h2 id="_options">OPTIONS</h2>
Junio C Hamano9ae1a062006-07-10 08:12:341084<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311085<div class="vlist"><dl>
Junio C Hamano9ae1a062006-07-10 08:12:341086<dt>
Junio C Hamano00cb3712007-02-23 11:13:521087--shared[={false|true|umask|group|all|world|everybody}]
Junio C Hamano43d01342006-10-12 04:07:321088</dt>
1089<dt>
1090--template=&lt;template_directory&gt;
1091</dt>
1092<dd>
1093<p>
1094 Only used with the <em>init</em> command.
Junio C Hamano48bc1ce2009-07-09 16:49:191095 These are passed directly to <em>git init</em>.
Junio C Hamano43d01342006-10-12 04:07:321096</p>
1097</dd>
1098<dt>
Junio C Hamano9ae1a062006-07-10 08:12:341099-r &lt;ARG&gt;
1100</dt>
1101<dt>
1102--revision &lt;ARG&gt;
1103</dt>
1104<dd>
1105<p>
Junio C Hamano48bc1ce2009-07-09 16:49:191106 Used with the <em>fetch</em> command.
Junio C Hamano9ae1a062006-07-10 08:12:341107</p>
Junio C Hamanoba4b9282008-07-06 05:20:311108<div class="para"><p>This allows revision ranges for partial/cauterized history
Junio C Hamano00cb3712007-02-23 11:13:521109to be supported. $NUMBER, $NUMBER1:$NUMBER2 (numeric ranges),
Junio C Hamanoba4b9282008-07-06 05:20:311110$NUMBER:HEAD, and BASE:$NUMBER are all supported.</p></div>
1111<div class="para"><p>This can allow you to make partial mirrors when running fetch;
Junio C Hamano00cb3712007-02-23 11:13:521112but is generally not recommended because history will be skipped
Junio C Hamanoba4b9282008-07-06 05:20:311113and lost.</p></div>
Junio C Hamano9ae1a062006-07-10 08:12:341114</dd>
1115<dt>
1116-
1117</dt>
1118<dt>
1119--stdin
1120</dt>
1121<dd>
1122<p>
Junio C Hamano48bc1ce2009-07-09 16:49:191123 Only used with the <em>set-tree</em> command.
Junio C Hamano9ae1a062006-07-10 08:12:341124</p>
Junio C Hamanoba4b9282008-07-06 05:20:311125<div class="para"><p>Read a list of commits from stdin and commit them in reverse
Junio C Hamano9ae1a062006-07-10 08:12:341126order. Only the leading sha1 is read from each line, so
Junio C Hamano48bc1ce2009-07-09 16:49:191127<em>git rev-list --pretty=oneline</em> output can be used.</p></div>
Junio C Hamano9ae1a062006-07-10 08:12:341128</dd>
1129<dt>
1130--rmdir
1131</dt>
1132<dd>
1133<p>
Junio C Hamano48bc1ce2009-07-09 16:49:191134 Only used with the <em>dcommit</em>, <em>set-tree</em> and <em>commit-diff</em> commands.
Junio C Hamano9ae1a062006-07-10 08:12:341135</p>
Junio C Hamanoba4b9282008-07-06 05:20:311136<div class="para"><p>Remove directories from the SVN tree if there are no files left
Junio C Hamano9ae1a062006-07-10 08:12:341137behind. SVN can version empty directories, and they are not
1138removed by default if there are no files left in them. git
1139cannot version empty directories. Enabling this flag will make
Junio C Hamanoba4b9282008-07-06 05:20:311140the commit to SVN act like git.</p></div>
Junio C Hamano48bc1ce2009-07-09 16:49:191141<div class="verseblock">
1142<div class="content">config key: svn.rmdir</div></div>
Junio C Hamano9ae1a062006-07-10 08:12:341143</dd>
1144<dt>
1145-e
1146</dt>
1147<dt>
1148--edit
1149</dt>
1150<dd>
1151<p>
Junio C Hamano48bc1ce2009-07-09 16:49:191152 Only used with the <em>dcommit</em>, <em>set-tree</em> and <em>commit-diff</em> commands.
Junio C Hamano9ae1a062006-07-10 08:12:341153</p>
Junio C Hamanoba4b9282008-07-06 05:20:311154<div class="para"><p>Edit the commit message before committing to SVN. This is off by
Junio C Hamano9ae1a062006-07-10 08:12:341155default for objects that are commits, and forced on when committing
Junio C Hamanoba4b9282008-07-06 05:20:311156tree objects.</p></div>
Junio C Hamano48bc1ce2009-07-09 16:49:191157<div class="verseblock">
1158<div class="content">config key: svn.edit</div></div>
Junio C Hamano9ae1a062006-07-10 08:12:341159</dd>
1160<dt>
1161-l&lt;num&gt;
1162</dt>
1163<dt>
1164--find-copies-harder
1165</dt>
1166<dd>
1167<p>
Junio C Hamano48bc1ce2009-07-09 16:49:191168 Only used with the <em>dcommit</em>, <em>set-tree</em> and <em>commit-diff</em> commands.
Junio C Hamano9ae1a062006-07-10 08:12:341169</p>
Junio C Hamano48bc1ce2009-07-09 16:49:191170<div class="para"><p>They are both passed directly to <em>git diff-tree</em>; see
Junio C Hamanoba4b9282008-07-06 05:20:311171<a href="git-diff-tree.html">git-diff-tree(1)</a> for more information.</p></div>
Junio C Hamano6b2cee12006-08-26 08:43:311172<div class="verseblock">
Junio C Hamano7ad22dc2007-01-29 02:55:481173<div class="content">config key: svn.l
1174config key: svn.findcopiesharder</div></div>
Junio C Hamano9ae1a062006-07-10 08:12:341175</dd>
1176<dt>
1177-A&lt;filename&gt;
1178</dt>
1179<dt>
1180--authors-file=&lt;filename&gt;
1181</dt>
1182<dd>
1183<p>
Junio C Hamano48bc1ce2009-07-09 16:49:191184 Syntax is compatible with the file used by <em>git cvsimport</em>:
Junio C Hamano9ae1a062006-07-10 08:12:341185</p>
Junio C Hamano9ae1a062006-07-10 08:12:341186<div class="listingblock">
1187<div class="content">
Junio C Hamano6b2cee12006-08-26 08:43:311188<pre><tt> loginname = Joe User &lt;user@example.com&gt;</tt></pre>
Junio C Hamano9ae1a062006-07-10 08:12:341189</div></div>
Junio C Hamano48bc1ce2009-07-09 16:49:191190<div class="para"><p>If this option is specified and <em>git svn</em> encounters an SVN
1191committer name that does not exist in the authors-file, <em>git svn</em>
Junio C Hamano9ae1a062006-07-10 08:12:341192will abort operation. The user will then have to add the
Junio C Hamano48bc1ce2009-07-09 16:49:191193appropriate entry. Re-running the previous <em>git svn</em> command
Junio C Hamanoba4b9282008-07-06 05:20:311194after the authors-file is modified should continue operation.</p></div>
Junio C Hamano48bc1ce2009-07-09 16:49:191195<div class="verseblock">
1196<div class="content">config key: svn.authorsfile</div></div>
Junio C Hamano43d01342006-10-12 04:07:321197</dd>
1198<dt>
Junio C Hamano52d5def2009-05-21 16:27:431199--authors-prog=&lt;filename&gt;
1200</dt>
1201<dd>
1202<p>
Junio C Hamano48bc1ce2009-07-09 16:49:191203 If this option is specified, for each SVN committer name that
1204 does not exist in the authors file, the given file is executed
1205 with the committer name as the first argument. The program is
1206 expected to return a single line of the form "Name &lt;email&gt;",
1207 which will be treated as if included in the authors file.
Junio C Hamano52d5def2009-05-21 16:27:431208</p>
1209</dd>
1210<dt>
Junio C Hamano43d01342006-10-12 04:07:321211-q
1212</dt>
1213<dt>
1214--quiet
1215</dt>
1216<dd>
1217<p>
Junio C Hamano48bc1ce2009-07-09 16:49:191218 Make <em>git svn</em> less verbose. Specify a second time to make it
Junio C Hamano9572e922009-04-02 06:52:031219 even less verbose.
Junio C Hamano43d01342006-10-12 04:07:321220</p>
1221</dd>
1222<dt>
1223--repack[=&lt;n&gt;]
1224</dt>
Junio C Hamanoa3fd83c2007-03-02 10:34:361225<dt>
1226--repack-flags=&lt;flags&gt;
1227</dt>
Junio C Hamano43d01342006-10-12 04:07:321228<dd>
1229<p>
Junio C Hamano48bc1ce2009-07-09 16:49:191230 These should help keep disk usage sane for large fetches with
1231 many revisions.
Junio C Hamano43d01342006-10-12 04:07:321232</p>
Junio C Hamanoba4b9282008-07-06 05:20:311233<div class="para"><p>--repack takes an optional argument for the number of revisions
Junio C Hamano43d01342006-10-12 04:07:321234to fetch before repacking. This defaults to repacking every
Junio C Hamanoba4b9282008-07-06 05:20:3112351000 commits fetched if no argument is specified.</p></div>
Junio C Hamano48bc1ce2009-07-09 16:49:191236<div class="para"><p>--repack-flags are passed directly to <em>git repack</em>.</p></div>
Junio C Hamanoa3fd83c2007-03-02 10:34:361237<div class="verseblock">
1238<div class="content">config key: svn.repack
1239config key: svn.repackflags</div></div>
Junio C Hamano6b2cee12006-08-26 08:43:311240</dd>
1241<dt>
1242-m
1243</dt>
1244<dt>
1245--merge
1246</dt>
1247<dt>
1248-s&lt;strategy&gt;
1249</dt>
1250<dt>
1251--strategy=&lt;strategy&gt;
1252</dt>
1253<dd>
1254<p>
Junio C Hamano48bc1ce2009-07-09 16:49:191255 These are only used with the <em>dcommit</em> and <em>rebase</em> commands.
Junio C Hamano6b2cee12006-08-26 08:43:311256</p>
Junio C Hamano48bc1ce2009-07-09 16:49:191257<div class="para"><p>Passed directly to <em>git rebase</em> when using <em>dcommit</em> if a
1258<em>git reset</em> cannot be used (see <em>dcommit</em>).</p></div>
Junio C Hamano6b2cee12006-08-26 08:43:311259</dd>
1260<dt>
1261-n
1262</dt>
1263<dt>
1264--dry-run
1265</dt>
1266<dd>
1267<p>
Junio C Hamano48bc1ce2009-07-09 16:49:191268 This can be used with the <em>dcommit</em>, <em>rebase</em>, <em>branch</em> and
1269 <em>tag</em> commands.
Junio C Hamano6b2cee12006-08-26 08:43:311270</p>
Junio C Hamanoba4b9282008-07-06 05:20:311271<div class="para"><p>For <em>dcommit</em>, print out the series of git arguments that would show
1272which diffs would be committed to SVN.</p></div>
1273<div class="para"><p>For <em>rebase</em>, display the local branch associated with the upstream svn
Junio C Hamano9e1793f2008-06-02 07:31:161274repository associated with the current branch and the URL of svn
Junio C Hamanoba4b9282008-07-06 05:20:311275repository that will be fetched from.</p></div>
Junio C Hamanoa476efa2008-10-10 15:31:421276<div class="para"><p>For <em>branch</em> and <em>tag</em>, display the urls that will be used for copying when
1277creating the branch or tag.</p></div>
Junio C Hamano6b2cee12006-08-26 08:43:311278</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311279</dl></div>
Junio C Hamano9ae1a062006-07-10 08:12:341280</div>
Junio C Hamanoba4b9282008-07-06 05:20:311281<h2 id="_advanced_options">ADVANCED OPTIONS</h2>
Junio C Hamano9ae1a062006-07-10 08:12:341282<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311283<div class="vlist"><dl>
Junio C Hamano9ae1a062006-07-10 08:12:341284<dt>
Junio C Hamano9ae1a062006-07-10 08:12:341285-i&lt;GIT_SVN_ID&gt;
1286</dt>
1287<dt>
1288--id &lt;GIT_SVN_ID&gt;
1289</dt>
1290<dd>
1291<p>
Junio C Hamano48bc1ce2009-07-09 16:49:191292 This sets GIT_SVN_ID (instead of using the environment). This
1293 allows the user to override the default refname to fetch from
1294 when tracking a single URL. The <em>log</em> and <em>dcommit</em> commands
1295 no longer require this switch as an argument.
Junio C Hamano00cb3712007-02-23 11:13:521296</p>
1297</dd>
1298<dt>
1299-R&lt;remote name&gt;
1300</dt>
1301<dt>
1302--svn-remote &lt;remote name&gt;
1303</dt>
1304<dd>
1305<p>
1306 Specify the [svn-remote "&lt;remote name&gt;"] section to use,
1307 this allows SVN multiple repositories to be tracked.
1308 Default: "svn"
Junio C Hamano9ae1a062006-07-10 08:12:341309</p>
1310</dd>
Junio C Hamano43d01342006-10-12 04:07:321311<dt>
1312--follow-parent
1313</dt>
1314<dd>
1315<p>
1316 This is especially helpful when we're tracking a directory
1317 that has been moved around within the repository, or if we
1318 started tracking a branch and never tracked the trunk it was
Junio C Hamano00cb3712007-02-23 11:13:521319 descended from. This feature is enabled by default, use
1320 --no-follow-parent to disable it.
Junio C Hamano43d01342006-10-12 04:07:321321</p>
Junio C Hamano48bc1ce2009-07-09 16:49:191322<div class="verseblock">
1323<div class="content">config key: svn.followparent</div></div>
Junio C Hamano43d01342006-10-12 04:07:321324</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311325</dl></div>
Junio C Hamano00cb3712007-02-23 11:13:521326</div>
Junio C Hamanoba4b9282008-07-06 05:20:311327<h2 id="_config_file_only_options">CONFIG FILE-ONLY OPTIONS</h2>
Junio C Hamano00cb3712007-02-23 11:13:521328<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311329<div class="vlist"><dl>
Junio C Hamano43d01342006-10-12 04:07:321330<dt>
Junio C Hamano00cb3712007-02-23 11:13:521331svn.noMetadata
1332</dt>
1333<dt>
1334svn-remote.&lt;name&gt;.noMetadata
Junio C Hamano43d01342006-10-12 04:07:321335</dt>
1336<dd>
1337<p>
Junio C Hamano48bc1ce2009-07-09 16:49:191338 This gets rid of the <em>git-svn-id:</em> lines at the end of every commit.
Junio C Hamano43d01342006-10-12 04:07:321339</p>
Junio C Hamano48bc1ce2009-07-09 16:49:191340<div class="para"><p>If you lose your .git/svn/git-svn/.rev_db file, <em>git svn</em> will not
Junio C Hamano00cb3712007-02-23 11:13:521341be able to rebuild it and you won't be able to fetch again,
Junio C Hamanoba4b9282008-07-06 05:20:311342either. This is fine for one-shot imports.</p></div>
Junio C Hamano48bc1ce2009-07-09 16:49:191343<div class="para"><p>The <em>git svn log</em> command will not work on repositories using
Junio C Hamanoa3fd83c2007-03-02 10:34:361344this, either. Using this conflicts with the <em>useSvmProps</em>
Junio C Hamanoba4b9282008-07-06 05:20:311345option for (hopefully) obvious reasons.</p></div>
Junio C Hamano43d01342006-10-12 04:07:321346</dd>
Junio C Hamano9ae1a062006-07-10 08:12:341347<dt>
Junio C Hamano00cb3712007-02-23 11:13:521348svn.useSvmProps
1349</dt>
1350<dt>
1351svn-remote.&lt;name&gt;.useSvmProps
Junio C Hamano9ae1a062006-07-10 08:12:341352</dt>
1353<dd>
1354<p>
Junio C Hamano48bc1ce2009-07-09 16:49:191355 This allows <em>git svn</em> to re-map repository URLs and UUIDs from
1356 mirrors created using SVN::Mirror (or svk) for metadata.
Junio C Hamano9ae1a062006-07-10 08:12:341357</p>
Junio C Hamanoba4b9282008-07-06 05:20:311358<div class="para"><p>If an SVN revision has a property, "svm:headrev", it is likely
Junio C Hamano00cb3712007-02-23 11:13:521359that the revision was created by SVN::Mirror (also used by SVK).
1360The property contains a repository UUID and a revision. We want
1361to make it look like we are mirroring the original URL, so
1362introduce a helper function that returns the original identity
1363URL and UUID, and use it when generating metadata in commit
Junio C Hamanoba4b9282008-07-06 05:20:311364messages.</p></div>
Junio C Hamano9ae1a062006-07-10 08:12:341365</dd>
1366<dt>
Junio C Hamano00cb3712007-02-23 11:13:521367svn.useSvnsyncProps
1368</dt>
1369<dt>
1370svn-remote.&lt;name&gt;.useSvnsyncprops
Junio C Hamano47c1e3c2006-09-25 04:45:551371</dt>
1372<dd>
1373<p>
Junio C Hamano00cb3712007-02-23 11:13:521374 Similar to the useSvmProps option; this is for users
1375 of the svnsync(1) command distributed with SVN 1.4.x and
1376 later.
Junio C Hamano47c1e3c2006-09-25 04:45:551377</p>
Junio C Hamano00cb3712007-02-23 11:13:521378</dd>
1379<dt>
1380svn-remote.&lt;name&gt;.rewriteRoot
1381</dt>
1382<dd>
1383<p>
1384 This allows users to create repositories from alternate
Junio C Hamano48bc1ce2009-07-09 16:49:191385 URLs. For example, an administrator could run <em>git svn</em> on the
Junio C Hamano00cb3712007-02-23 11:13:521386 server locally (accessing via file://) but wish to distribute
1387 the repository with a public http:// or svn:// URL in the
1388 metadata so users of it will see the public URL.
1389</p>
Junio C Hamano0538b892008-06-20 04:18:331390</dd>
Junio C Hamanob3250062009-02-11 20:16:501391<dt>
Junio C Hamanod0d892c2010-01-24 20:06:291392svn-remote.&lt;name&gt;.rewriteUUID
1393</dt>
1394<dd>
1395<p>
1396 Similar to the useSvmProps option; this is for users who need
1397 to remap the UUID manually. This may be useful in situations
1398 where the original UUID is not available via either useSvmProps
1399 or useSvnsyncProps.
1400</p>
1401</dd>
1402<dt>
Junio C Hamanob3250062009-02-11 20:16:501403svn.brokenSymlinkWorkaround
1404</dt>
1405<dd>
1406<p>
Junio C Hamano48bc1ce2009-07-09 16:49:191407 This disables potentially expensive checks to workaround
1408 broken symlinks checked into SVN by broken clients. Set this
1409 option to "false" if you track a SVN repository with many
1410 empty blobs that are not symlinks. This option may be changed
1411 while <em>git svn</em> is running and take effect on the next
1412 revision fetched. If unset, <em>git svn</em> assumes this option to
1413 be "true".
Junio C Hamanob3250062009-02-11 20:16:501414</p>
1415</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311416</dl></div>
Junio C Hamanod0d892c2010-01-24 20:06:291417<div class="para"><p>Since the noMetadata, rewriteRoot, rewriteUUID, useSvnsyncProps and useSvmProps
Junio C Hamano48bc1ce2009-07-09 16:49:191418options all affect the metadata generated and used by <em>git svn</em>; they
Junio C Hamano00cb3712007-02-23 11:13:521419<strong>must</strong> be set in the configuration file before any history is imported
Junio C Hamanoba4b9282008-07-06 05:20:311420and these settings should never be changed once they are set.</p></div>
Junio C Hamanod0d892c2010-01-24 20:06:291421<div class="para"><p>Additionally, only one of these options can be used per svn-remote
1422section because they affect the <em>git-svn-id:</em> metadata line, except
1423for rewriteRoot and rewriteUUID which can be used together.</p></div>
Junio C Hamanoa3fd83c2007-03-02 10:34:361424</div>
Junio C Hamanoba4b9282008-07-06 05:20:311425<h2 id="_basic_examples">BASIC EXAMPLES</h2>
Junio C Hamanoa3fd83c2007-03-02 10:34:361426<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311427<div class="para"><p>Tracking and contributing to the trunk of a Subversion-managed project:</p></div>
Junio C Hamano9ae1a062006-07-10 08:12:341428<div class="listingblock">
1429<div class="content">
Junio C Hamano00cb3712007-02-23 11:13:521430<pre><tt># Clone a repo (like git clone):
Junio C Hamanoa476efa2008-10-10 15:31:421431 git svn clone http://svn.example.com/project/trunk
Junio C Hamano00cb3712007-02-23 11:13:521432# Enter the newly cloned directory:
1433 cd trunk
Junio C Hamano48bc1ce2009-07-09 16:49:191434# You should be on master branch, double-check with 'git branch'
Junio C Hamano00cb3712007-02-23 11:13:521435 git branch
1436# Do some work and commit locally to git:
1437 git commit ...
1438# Something is committed to SVN, rebase your local changes against the
1439# latest changes in SVN:
Junio C Hamanofce7c7e2008-07-02 03:06:381440 git svn rebase
Junio C Hamano00cb3712007-02-23 11:13:521441# Now commit your changes (that were committed previously using git) to SVN,
1442# as well as automatically updating your working HEAD:
Junio C Hamanofce7c7e2008-07-02 03:06:381443 git svn dcommit
Junio C Hamano9ae1a062006-07-10 08:12:341444# Append svn:ignore settings to the default git exclude file:
Junio C Hamanofce7c7e2008-07-02 03:06:381445 git svn show-ignore &gt;&gt; .git/info/exclude</tt></pre>
Junio C Hamano9ae1a062006-07-10 08:12:341446</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311447<div class="para"><p>Tracking and contributing to an entire Subversion-managed project
1448(complete with a trunk, tags and branches):</p></div>
Junio C Hamanoa8d072a2007-01-05 07:46:251449<div class="listingblock">
1450<div class="content">
Junio C Hamano00cb3712007-02-23 11:13:521451<pre><tt># Clone a repo (like git clone):
Junio C Hamanoa476efa2008-10-10 15:31:421452 git svn clone http://svn.example.com/project -T trunk -b branches -t tags
Junio C Hamano00cb3712007-02-23 11:13:521453# View all branches and tags you have cloned:
1454 git branch -r
Junio C Hamanoa476efa2008-10-10 15:31:421455# Create a new branch in SVN
1456 git svn branch waldo
Junio C Hamano00cb3712007-02-23 11:13:521457# Reset your master to trunk (or any other branch, replacing 'trunk'
1458# with the appropriate name):
1459 git reset --hard remotes/trunk
1460# You may only dcommit to one branch/tag/trunk at a time. The usage
Junio C Hamanoa3fd83c2007-03-02 10:34:361461# of dcommit/rebase/show-ignore should be the same as above.</tt></pre>
Junio C Hamanoa8d072a2007-01-05 07:46:251462</div></div>
Junio C Hamano48bc1ce2009-07-09 16:49:191463<div class="para"><p>The initial <em>git svn clone</em> can be quite time-consuming
Junio C Hamanoe9bfa9b2007-08-07 06:06:111464(especially for large Subversion repositories). If multiple
1465people (or one person with multiple machines) want to use
Junio C Hamano48bc1ce2009-07-09 16:49:191466<em>git svn</em> to interact with the same Subversion repository, you can
1467do the initial <em>git svn clone</em> to a repository on a server and
1468have each person clone that repository with <em>git clone</em>:</p></div>
Junio C Hamanoe9bfa9b2007-08-07 06:06:111469<div class="listingblock">
1470<div class="content">
1471<pre><tt># Do the initial import on a server
Junio C Hamanoa476efa2008-10-10 15:31:421472 ssh server "cd /pub &amp;&amp; git svn clone http://svn.example.com/project
Junio C Hamanof7bb6692008-01-27 08:23:461473# Clone locally - make sure the refs/remotes/ space matches the server
1474 mkdir project
1475 cd project
Junio C Hamanofce7c7e2008-07-02 03:06:381476 git init
Junio C Hamanof7bb6692008-01-27 08:23:461477 git remote add origin server:/pub/project
Junio C Hamano9e7b3f32008-06-29 08:49:031478 git config --add remote.origin.fetch '+refs/remotes/*:refs/remotes/*'
Junio C Hamanof7bb6692008-01-27 08:23:461479 git fetch
Junio C Hamanod3452a02008-11-15 08:07:551480# Create a local branch from one of the branches just fetched
1481 git checkout -b master FETCH_HEAD
Junio C Hamano48bc1ce2009-07-09 16:49:191482# Initialize 'git svn' locally (be sure to use the same URL and -T/-b/-t options as were used on server)
Junio C Hamanoa476efa2008-10-10 15:31:421483 git svn init http://svn.example.com/project
Junio C Hamanoe9bfa9b2007-08-07 06:06:111484# Pull the latest changes from Subversion
Junio C Hamanofce7c7e2008-07-02 03:06:381485 git svn rebase</tt></pre>
Junio C Hamanoe9bfa9b2007-08-07 06:06:111486</div></div>
Junio C Hamano9ae1a062006-07-10 08:12:341487</div>
Junio C Hamanoba4b9282008-07-06 05:20:311488<h2 id="_rebase_vs_pull_merge">REBASE VS. PULL/MERGE</h2>
Junio C Hamano6b2cee12006-08-26 08:43:311489<div class="sectionbody">
Junio C Hamano48bc1ce2009-07-09 16:49:191490<div class="para"><p>Originally, <em>git svn</em> recommended that the <em>remotes/git-svn</em> branch be
Junio C Hamano79770b62007-01-07 07:43:581491pulled or merged from. This is because the author favored
Junio C Hamanofce7c7e2008-07-02 03:06:381492<tt>git svn set-tree B</tt> to commit a single head rather than the
Junio C Hamanoba4b9282008-07-06 05:20:311493<tt>git svn set-tree A..B</tt> notation to commit multiple commits.</p></div>
1494<div class="para"><p>If you use <tt>git svn set-tree A..B</tt> to commit several diffs and you do
Junio C Hamano79770b62007-01-07 07:43:581495not have the latest remotes/git-svn merged into my-branch, you should
Junio C Hamanofce7c7e2008-07-02 03:06:381496use <tt>git svn rebase</tt> to update your work branch instead of <tt>git pull</tt> or
Junio C Hamano0e88f3e2009-06-21 08:03:251497<tt>git merge</tt>. <tt>pull</tt>/<tt>merge</tt> can cause non-linear history to be flattened
Junio C Hamano79770b62007-01-07 07:43:581498when committing into SVN, which can lead to merge commits reversing
Junio C Hamanoba4b9282008-07-06 05:20:311499previous commits in SVN.</p></div>
Junio C Hamano6b2cee12006-08-26 08:43:311500</div>
Junio C Hamanoba4b9282008-07-06 05:20:311501<h2 id="_design_philosophy">DESIGN PHILOSOPHY</h2>
Junio C Hamano9ae1a062006-07-10 08:12:341502<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311503<div class="para"><p>Merge tracking in Subversion is lacking and doing branched development
Junio C Hamano48bc1ce2009-07-09 16:49:191504with Subversion can be cumbersome as a result. While <em>git svn</em> can track
Junio C Hamanod2d9ae12007-09-19 02:27:571505copy history (including branches and tags) for repositories adopting a
1506standard layout, it cannot yet represent merge history that happened
1507inside git back upstream to SVN users. Therefore it is advised that
1508users keep history as linear as possible inside git to ease
Junio C Hamanoba4b9282008-07-06 05:20:311509compatibility with SVN (see the CAVEATS section below).</p></div>
Junio C Hamano9ae1a062006-07-10 08:12:341510</div>
Junio C Hamanoba4b9282008-07-06 05:20:311511<h2 id="_caveats">CAVEATS</h2>
Junio C Hamanobdebabb2007-08-23 00:25:091512<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311513<div class="para"><p>For the sake of simplicity and interoperating with a less-capable system
Junio C Hamano48bc1ce2009-07-09 16:49:191514(SVN), it is recommended that all <em>git svn</em> users clone, fetch and dcommit
1515directly from the SVN server, and avoid all <em>git clone</em>/<em>pull</em>/<em>merge</em>/<em>push</em>
Junio C Hamanobdebabb2007-08-23 00:25:091516operations between git repositories and branches. The recommended
1517method of exchanging code between git branches and users is
Junio C Hamano48bc1ce2009-07-09 16:49:191518<em>git format-patch</em> and <em>git am</em>, or just 'dcommit'ing to the SVN repository.</p></div>
1519<div class="para"><p>Running <em>git merge</em> or <em>git pull</em> is NOT recommended on a branch you
Junio C Hamanofce7c7e2008-07-02 03:06:381520plan to <em>dcommit</em> from. Subversion does not represent merges in any
Junio C Hamanobdebabb2007-08-23 00:25:091521reasonable or useful fashion; so users using Subversion cannot see any
1522merges you've made. Furthermore, if you merge or pull from a git branch
Junio C Hamanofce7c7e2008-07-02 03:06:381523that is a mirror of an SVN branch, <em>dcommit</em> may commit to the wrong
Junio C Hamanoba4b9282008-07-06 05:20:311524branch.</p></div>
Junio C Hamanoa5574462009-11-18 07:39:281525<div class="para"><p>If you do merge, note the following rule: <em>git svn dcommit</em> will
1526attempt to commit on top of the SVN commit named in</p></div>
1527<div class="listingblock">
1528<div class="content">
1529<pre><tt>git log --grep=^git-svn-id: --first-parent -1</tt></pre>
1530</div></div>
1531<div class="para"><p>You <em>must</em> therefore ensure that the most recent commit of the branch
1532you want to dcommit to is the <em>first</em> parent of the merge. Chaos will
1533ensue otherwise, especially if the first parent is an older commit on
1534the same SVN branch.</p></div>
Junio C Hamano48bc1ce2009-07-09 16:49:191535<div class="para"><p><em>git clone</em> does not clone branches under the refs/remotes/ hierarchy or
1536any <em>git svn</em> metadata, or config. So repositories created and managed with
1537using <em>git svn</em> should use <em>rsync</em> for cloning, if cloning is to be done
Junio C Hamanoba4b9282008-07-06 05:20:311538at all.</p></div>
Junio C Hamano48bc1ce2009-07-09 16:49:191539<div class="para"><p>Since <em>dcommit</em> uses rebase internally, any git branches you <em>git push</em> to
Junio C Hamanofce7c7e2008-07-02 03:06:381540before <em>dcommit</em> on will require forcing an overwrite of the existing ref
Junio C Hamanobdebabb2007-08-23 00:25:091541on the remote repository. This is generally considered bad practice,
Junio C Hamanoba4b9282008-07-06 05:20:311542see the <a href="git-push.html">git-push(1)</a> documentation for details.</p></div>
1543<div class="para"><p>Do not use the --amend option of <a href="git-commit.html">git-commit(1)</a> on a change you've
Junio C Hamanobdebabb2007-08-23 00:25:091544already dcommitted. It is considered bad practice to --amend commits
1545you've already pushed to a remote repository for other users, and
Junio C Hamanoba4b9282008-07-06 05:20:311546dcommit with SVN is analogous to that.</p></div>
Junio C Hamano48bc1ce2009-07-09 16:49:191547<div class="para"><p>When using multiple --branches or --tags, <em>git svn</em> does not automatically
Junio C Hamano688eae02009-06-28 05:19:501548handle name collisions (for example, if two branches from different paths have
1549the same name, or if a branch and a tag have the same name). In these cases,
1550use <em>init</em> to set up your git repository then, before your first <em>fetch</em>, edit
1551the .git/config file so that the branches and tags are associated with
1552different name spaces. For example:</p></div>
1553<div class="literalblock">
1554<div class="content">
1555<pre><tt>branches = stable/*:refs/remotes/svn/stable/*
1556branches = debug/*:refs/remotes/svn/debug/*</tt></pre>
1557</div></div>
Junio C Hamanobdebabb2007-08-23 00:25:091558</div>
Junio C Hamanoba4b9282008-07-06 05:20:311559<h2 id="_bugs">BUGS</h2>
Junio C Hamano9ae1a062006-07-10 08:12:341560<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311561<div class="para"><p>We ignore all SVN properties except svn:executable. Any unhandled
1562properties are logged to $GIT_DIR/svn/&lt;refname&gt;/unhandled.log</p></div>
1563<div class="para"><p>Renamed and copied directories are not detected by git and hence not
Junio C Hamano9ae1a062006-07-10 08:12:341564tracked when committing to SVN. I do not plan on adding support for
1565this as it's quite difficult and time-consuming to get working for all
Junio C Hamano00cb3712007-02-23 11:13:521566the possible corner cases (git doesn't do it, either). Committing
1567renamed and copied files are fully supported if they're similar enough
Junio C Hamanoba4b9282008-07-06 05:20:311568for git to detect them.</p></div>
Junio C Hamano00cb3712007-02-23 11:13:521569</div>
Junio C Hamanoba4b9282008-07-06 05:20:311570<h2 id="_configuration">CONFIGURATION</h2>
Junio C Hamano00cb3712007-02-23 11:13:521571<div class="sectionbody">
Junio C Hamano48bc1ce2009-07-09 16:49:191572<div class="para"><p><em>git svn</em> stores [svn-remote] configuration information in the
Junio C Hamano00cb3712007-02-23 11:13:521573repository .git/config file. It is similar the core git
1574[remote] sections except <em>fetch</em> keys do not accept glob
1575arguments; but they are instead handled by the <em>branches</em>
1576and <em>tags</em> keys. Since some SVN repositories are oddly
1577configured with multiple projects glob expansions such those
Junio C Hamanoba4b9282008-07-06 05:20:311578listed below are allowed:</p></div>
Junio C Hamano00cb3712007-02-23 11:13:521579<div class="listingblock">
1580<div class="content">
1581<pre><tt>[svn-remote "project-a"]
1582 url = http://server.org/svn
Junio C Hamano9572e922009-04-02 06:52:031583 fetch = trunk/project-a:refs/remotes/project-a/trunk
Junio C Hamano00cb3712007-02-23 11:13:521584 branches = branches/*/project-a:refs/remotes/project-a/branches/*
Junio C Hamano9572e922009-04-02 06:52:031585 tags = tags/*/project-a:refs/remotes/project-a/tags/*</tt></pre>
Junio C Hamano00cb3712007-02-23 11:13:521586</div></div>
Junio C Hamano07738342009-04-23 03:06:561587<div class="para"><p>Keep in mind that the <em>*</em> (asterisk) wildcard of the local ref
1588(right of the <em>:</em>) *must* be the farthest right path component;
1589however the remote wildcard may be anywhere as long as it's an
Junio C Hamanoa6387422007-08-25 03:54:271590independent path component (surrounded by <em>/</em> or EOL). This
Junio C Hamano00cb3712007-02-23 11:13:521591type of configuration is not automatically created by <em>init</em> and
Junio C Hamano48bc1ce2009-07-09 16:49:191592should be manually entered with a text-editor or using <em>git config</em>.</p></div>
Junio C Hamanod0d892c2010-01-24 20:06:291593<div class="para"><p>It is also possible to fetch a subset of branches or tags by using a
1594comma-separated list of names within braces. For example:</p></div>
1595<div class="listingblock">
1596<div class="content">
1597<pre><tt>[svn-remote "huge-project"]
1598 url = http://server.org/svn
1599 fetch = trunk/src:refs/remotes/trunk
1600 branches = branches/{red,green}/src:refs/remotes/branches/*
1601 tags = tags/{1.0,2.0}/src:refs/remotes/tags/*</tt></pre>
1602</div></div>
1603<div class="para"><p>Note that git-svn keeps track of the highest revision in which a branch
1604or tag has appeared. If the subset of branches or tags is changed after
1605fetching, then .git/svn/.metadata must be manually edited to remove (or
1606reset) branches-maxRev and/or tags-maxRev as appropriate.</p></div>
Junio C Hamano9ae1a062006-07-10 08:12:341607</div>
Junio C Hamanoba4b9282008-07-06 05:20:311608<h2 id="_see_also">SEE ALSO</h2>
Junio C Hamano6b2cee12006-08-26 08:43:311609<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311610<div class="para"><p><a href="git-rebase.html">git-rebase(1)</a></p></div>
Junio C Hamano6b2cee12006-08-26 08:43:311611</div>
Junio C Hamanoba4b9282008-07-06 05:20:311612<h2 id="_author">Author</h2>
Junio C Hamano9ae1a062006-07-10 08:12:341613<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311614<div class="para"><p>Written by Eric Wong &lt;normalperson@yhbt.net&gt;.</p></div>
Junio C Hamano9ae1a062006-07-10 08:12:341615</div>
Junio C Hamanoba4b9282008-07-06 05:20:311616<h2 id="_documentation">Documentation</h2>
Junio C Hamano9ae1a062006-07-10 08:12:341617<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311618<div class="para"><p>Written by Eric Wong &lt;normalperson@yhbt.net&gt;.</p></div>
Junio C Hamano9ae1a062006-07-10 08:12:341619</div>
1620<div id="footer">
1621<div id="footer-text">
Junio C Hamanodca34822010-02-13 01:02:521622Last updated 2010-02-13 00:59:58 UTC
Junio C Hamano9ae1a062006-07-10 08:12:341623</div>
1624</div>
1625</body>
1626</html>