blob: b3f30295e254def2fbb981914d2ef11a0f55a822 [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" />
6<meta name="generator" content="AsciiDoc 7.0.2" />
7<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
19a { color: blue; }
20a:visited { color: fuchsia; }
21
22em {
23 font-style: italic;
24}
25
26strong {
27 font-weight: bold;
28}
29
30tt {
31 color: navy;
32}
33
34h1, h2, h3, h4, h5, h6 {
35 color: #527bbd;
36 font-family: sans-serif;
37 margin-top: 1.2em;
38 margin-bottom: 0.5em;
39 line-height: 1.3;
40}
41
42h1 {
43 border-bottom: 2px solid silver;
44}
45h2 {
46 border-bottom: 2px solid silver;
47 padding-top: 0.5em;
48}
49
50div.sectionbody {
51 font-family: serif;
52 margin-left: 0;
53}
54
55hr {
56 border: 1px solid silver;
57}
58
59p {
60 margin-top: 0.5em;
61 margin-bottom: 0.5em;
62}
63
64pre {
65 padding: 0;
66 margin: 0;
67}
68
69span#author {
70 color: #527bbd;
71 font-family: sans-serif;
72 font-weight: bold;
73 font-size: 1.2em;
74}
75span#email {
76}
77span#revision {
78 font-family: sans-serif;
79}
80
81div#footer {
82 font-family: sans-serif;
83 font-size: small;
84 border-top: 2px solid silver;
85 padding-top: 0.5em;
86 margin-top: 4.0em;
87}
88div#footer-text {
89 float: left;
90 padding-bottom: 0.5em;
91}
92div#footer-badges {
93 float: right;
94 padding-bottom: 0.5em;
95}
96
97div#preamble,
98div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
99div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
100div.admonitionblock {
101 margin-right: 10%;
102 margin-top: 1.5em;
103 margin-bottom: 1.5em;
104}
105div.admonitionblock {
106 margin-top: 2.5em;
107 margin-bottom: 2.5em;
108}
109
110div.content { /* Block element content. */
111 padding: 0;
112}
113
114/* Block element titles. */
115div.title, caption.title {
116 font-family: sans-serif;
117 font-weight: bold;
118 text-align: left;
119 margin-top: 1.0em;
120 margin-bottom: 0.5em;
121}
122div.title + * {
123 margin-top: 0;
124}
125
126td div.title:first-child {
127 margin-top: 0.0em;
128}
129div.content div.title:first-child {
130 margin-top: 0.0em;
131}
132div.content + div.title {
133 margin-top: 0.0em;
134}
135
136div.sidebarblock > div.content {
137 background: #ffffee;
138 border: 1px solid silver;
139 padding: 0.5em;
140}
141
142div.listingblock > div.content {
143 border: 1px solid silver;
144 background: #f4f4f4;
145 padding: 0.5em;
146}
147
148div.quoteblock > div.content {
149 padding-left: 2.0em;
150}
151div.quoteblock .attribution {
152 text-align: right;
153}
154
155div.admonitionblock .icon {
156 vertical-align: top;
157 font-size: 1.1em;
158 font-weight: bold;
159 text-decoration: underline;
160 color: #527bbd;
161 padding-right: 0.5em;
162}
163div.admonitionblock td.content {
164 padding-left: 0.5em;
165 border-left: 2px solid silver;
166}
167
168div.exampleblock > div.content {
169 border-left: 2px solid silver;
170 padding: 0.5em;
171}
172
173div.verseblock div.content {
174 white-space: pre;
175}
176
177div.imageblock div.content { padding-left: 0; }
178div.imageblock img { border: 1px solid silver; }
179span.image img { border-style: none; }
180
181dl {
182 margin-top: 0.8em;
183 margin-bottom: 0.8em;
184}
185dt {
186 margin-top: 0.5em;
187 margin-bottom: 0;
188 font-style: italic;
189}
190dd > *:first-child {
191 margin-top: 0;
192}
193
194ul, ol {
195 list-style-position: outside;
196}
197ol.olist2 {
198 list-style-type: lower-alpha;
199}
200
201div.tableblock > table {
202 border-color: #527bbd;
203 border-width: 3px;
204}
205thead {
206 font-family: sans-serif;
207 font-weight: bold;
208}
209tfoot {
210 font-weight: bold;
211}
212
213div.hlist {
214 margin-top: 0.8em;
215 margin-bottom: 0.8em;
216}
217td.hlist1 {
218 vertical-align: top;
219 font-style: italic;
220 padding-right: 0.8em;
221}
222td.hlist2 {
223 vertical-align: top;
224}
225
226@media print {
227 div#footer-badges { display: none; }
228}
229include::./stylesheets/xhtml11-manpage.css[]
230/* Workarounds for IE6's broken and incomplete CSS2. */
231
232div.sidebar-content {
233 background: #ffffee;
234 border: 1px solid silver;
235 padding: 0.5em;
236}
237div.sidebar-title, div.image-title {
238 font-family: sans-serif;
239 font-weight: bold;
240 margin-top: 0.0em;
241 margin-bottom: 0.5em;
242}
243
244div.listingblock div.content {
245 border: 1px solid silver;
246 background: #f4f4f4;
247 padding: 0.5em;
248}
249
250div.quoteblock-content {
251 padding-left: 2.0em;
252}
253
254div.exampleblock-content {
255 border-left: 2px solid silver;
256 padding-left: 0.5em;
257}
258</style>
259<title>git-svn(1)</title>
260</head>
261<body>
262<div id="header">
263<h1>
264git-svn(1) Manual Page
265</h1>
266<h2>NAME</h2>
267<div class="sectionbody">
268<p>git-svn -
Junio C Hamano7c73c662007-01-19 00:37:50269 Bidirectional operation between a single Subversion branch and git
Junio C Hamano9ae1a062006-07-10 08:12:34270</p>
271</div>
272</div>
273<h2>SYNOPSIS</h2>
274<div class="sectionbody">
275<p><em>git-svn</em> &lt;command&gt; [options] [arguments]</p>
276</div>
277<h2>DESCRIPTION</h2>
278<div class="sectionbody">
Junio C Hamanoa8d072a2007-01-05 07:46:25279<p>git-svn is a simple conduit for changesets between Subversion and git.
280It is not to be confused with <a href="git-svnimport.html">git-svnimport(1)</a>, which is
Junio C Hamano00cb3712007-02-23 11:13:52281read-only.</p>
Junio C Hamanoa8d072a2007-01-05 07:46:25282<p>git-svn was originally designed for an individual developer who wants a
Junio C Hamano9ae1a062006-07-10 08:12:34283bidirectional flow of changesets between a single branch in Subversion
Junio C Hamanoa8d072a2007-01-05 07:46:25284and an arbitrary number of branches in git. Since its inception,
285git-svn has gained the ability to track multiple branches in a manner
Junio C Hamano00cb3712007-02-23 11:13:52286similar to git-svnimport.</p>
Junio C Hamanoa8d072a2007-01-05 07:46:25287<p>git-svn is especially useful when it comes to tracking repositories
288not organized in the way Subversion developers recommend (trunk,
289branches, tags directories).</p>
Junio C Hamano9ae1a062006-07-10 08:12:34290</div>
291<h2>COMMANDS</h2>
292<div class="sectionbody">
293<dl>
294<dt>
Junio C Hamano6b2cee12006-08-26 08:43:31295<em>init</em>
Junio C Hamano9ae1a062006-07-10 08:12:34296</dt>
297<dd>
298<p>
Junio C Hamano00cb3712007-02-23 11:13:52299 Initializes an empty git repository with additional
300 metadata directories for git-svn. The Subversion URL
301 may be specified as a command-line argument, or as full
302 URL arguments to -T/-t/-b. Optionally, the target
303 directory to operate on can be specified as a second
304 argument. Normally this command initializes the current
305 directory.
Junio C Hamano9ae1a062006-07-10 08:12:34306</p>
307</dd>
308<dt>
Junio C Hamano00cb3712007-02-23 11:13:52309-T&lt;trunk_subdir&gt;
310</dt>
311<dt>
312--trunk=&lt;trunk_subdir&gt;
313</dt>
314<dt>
315-t&lt;tags_subdir&gt;
316</dt>
317<dt>
318--tags=&lt;tags_subdir&gt;
319</dt>
320<dt>
321-b&lt;branches_subdir&gt;
322</dt>
323<dt>
324--branches=&lt;branches_subdir&gt;
325</dt>
326<dd>
327<p>
328 These are optional command-line options for init. Each of
329 these flags can point to a relative repository path
330 (--tags=project/tags') or a full url
331 (--tags=https://foo.org/project/tags)
332</p>
333</dd>
334<dt>
335--no-metadata
336</dt>
337<dd>
338<p>
339 Set the <em>noMetadata</em> option in the [svn-remote] config.
340</p>
341</dd>
342<dt>
343--use-svm-props
344</dt>
345<dd>
346<p>
347 Set the <em>useSvmProps</em> option in the [svn-remote] config.
348</p>
349</dd>
350<dt>
351--use-svnsync-props
352</dt>
353<dd>
354<p>
355 Set the <em>useSvnsyncProps</em> option in the [svn-remote] config.
356</p>
357</dd>
358<dt>
359--rewrite-root=&lt;URL&gt;
360</dt>
361<dd>
362<p>
363 Set the <em>rewriteRoot</em> option in the [svn-remote] config.
364</p>
365</dd>
366<dt>
367--username=&lt;USER&gt;
368</dt>
369<dd>
370<p>
371 For transports that SVN handles authentication for (http,
372 https, and plain svn), specify the username. For other
373 transports (eg svn+ssh://), you must include the username in
374 the URL, eg svn+ssh://foo@svn.bar.com/project
375</p>
Junio C Hamanoa3fd83c2007-03-02 10:34:36376</dd>
377<dt>
378--prefix=&lt;prefix&gt;
379</dt>
380<dd>
381<p>
Junio C Hamano00cb3712007-02-23 11:13:52382 This allows one to specify a prefix which is prepended
383 to the names of remotes if trunk/branches/tags are
384 specified. The prefix does not automatically include a
385 trailing slash, so be sure you include one in the
386 argument if that is what you want. This is useful if
387 you wish to track multiple projects that share a common
Junio C Hamanoa3fd83c2007-03-02 10:34:36388 repository.
389</p>
Junio C Hamano00cb3712007-02-23 11:13:52390</dd>
391<dt>
Junio C Hamano6b2cee12006-08-26 08:43:31392<em>fetch</em>
Junio C Hamano9ae1a062006-07-10 08:12:34393</dt>
394<dd>
395<p>
Junio C Hamano00cb3712007-02-23 11:13:52396 Fetch unfetched revisions from the Subversion remote we are
397 tracking. The name of the [svn-remote "&#8230;"] section in the
398 .git/config file may be specified as an optional command-line
399 argument.
Junio C Hamano9ae1a062006-07-10 08:12:34400</p>
Junio C Hamano00cb3712007-02-23 11:13:52401</dd>
402<dt>
403<em>clone</em>
404</dt>
405<dd>
406<p>
407 Runs <em>init</em> and <em>fetch</em>. It will automatically create a
408 directory based on the basename of the URL passed to it;
409 or if a second argument is passed; it will create a directory
410 and work within that. It accepts all arguments that the
411 <em>init</em> and <em>fetch</em> commands accept; with the exception of
412 <em>--fetch-all</em>. After a repository is cloned, the <em>fetch</em>
413 command will be able to update revisions without affecting
414 the working tree; and the <em>rebase</em> command will be able
415 to update the working tree with the latest changes.
416</p>
417</dd>
418<dt>
419<em>rebase</em>
420</dt>
421<dd>
422<p>
423 This fetches revisions from the SVN parent of the current HEAD
424 and rebases the current (uncommitted to SVN) work against it.
425</p>
Junio C Hamanoa3fd83c2007-03-02 10:34:36426<p>This works similarly to <em>svn update</em> or <em>git-pull</em> except that
427it preserves linear history with <em>git-rebase</em> instead of
428<em>git-merge</em> for ease of dcommit-ing with git-svn.</p>
429<p>This accepts all options that <em>git-svn fetch</em> and <em>git-rebase</em>
430accepts. However <em>--fetch-all</em> only fetches from the current
431[svn-remote], and not all [svn-remote] definitions.</p>
432<p>Like <em>git-rebase</em>; this requires that the working tree be clean
433and have no uncommitted changes.</p>
Junio C Hamano103ad7f2007-03-14 11:19:26434<p>+</p>
Junio C Hamano9ae1a062006-07-10 08:12:34435</dd>
Junio C Hamano103ad7f2007-03-14 11:19:26436</dl>
437<dl>
438<dt>
439-l
440</dt>
441<dt>
442--local
443</dt>
444<dd>
445<p>
446 Do not fetch remotely; only run <em>git-rebase</em> against the
447 last fetched commit from the upstream SVN.
448</p>
449</dd>
450</dl>
451<p>+</p>
452<dl>
Junio C Hamano9ae1a062006-07-10 08:12:34453<dt>
Junio C Hamano6b2cee12006-08-26 08:43:31454<em>dcommit</em>
455</dt>
456<dd>
457<p>
Junio C Hamano79770b62007-01-07 07:43:58458 Commit each diff from a specified head directly to the SVN
Junio C Hamano6b2cee12006-08-26 08:43:31459 repository, and then rebase or reset (depending on whether or
Junio C Hamano79770b62007-01-07 07:43:58460 not there is a diff between SVN and head). This will create
461 a revision in SVN for each commit in git.
462 It is recommended that you run git-svn fetch and rebase (not
463 pull or merge) your commits against the latest changes in the
464 SVN repository.
Junio C Hamano511162f2006-12-13 06:35:48465 An optional command-line argument may be specified as an
466 alternative to HEAD.
Junio C Hamano4bf6dca2006-12-21 02:25:57467 This is advantageous over <em>set-tree</em> (below) because it produces
Junio C Hamano6b2cee12006-08-26 08:43:31468 cleaner, more linear history.
469</p>
470</dd>
Junio C Hamanoa3fd83c2007-03-02 10:34:36471</dl>
472<dl>
Junio C Hamano6b2cee12006-08-26 08:43:31473<dt>
Junio C Hamano43d01342006-10-12 04:07:32474<em>log</em>
475</dt>
476<dd>
477<p>
478 This should make it easy to look up svn log messages when svn
479 users refer to -r/--revision numbers.
480</p>
Junio C Hamanoa3fd83c2007-03-02 10:34:36481<p>The following features from `svn log' are supported:</p>
482<dl>
483<dt>
484--revision=&lt;n&gt;[:&lt;n&gt;]
485</dt>
486<dd>
487<p>
488 is supported, non-numeric args are not:
489 HEAD, NEXT, BASE, PREV, etc &#8230;
490</p>
Junio C Hamano43d01342006-10-12 04:07:32491</dd>
492<dt>
Junio C Hamanoa3fd83c2007-03-02 10:34:36493-v/--verbose
494</dt>
495<dd>
496<p>
497 it's not completely compatible with the --verbose
498 output in svn log, but reasonably close.
499</p>
500</dd>
501<dt>
502--limit=&lt;n&gt;
503</dt>
504<dd>
505<p>
506 is NOT the same as --max-count, doesn't count
507 merged/excluded commits
508</p>
509</dd>
510<dt>
511--incremental
512</dt>
513<dd>
514<p>
515 supported
516</p>
517</dd>
518</dl>
519<p>New features:</p>
520<dl>
521<dt>
522--show-commit
523</dt>
524<dd>
525<p>
526 shows the git commit sha1, as well
527</p>
528</dd>
529<dt>
530--oneline
531</dt>
532<dd>
533<p>
534 our version of --pretty=oneline
535</p>
536</dd>
537</dl>
538<p>Any other arguments are passed directly to `git log'</p>
539</dd>
540</dl>
541<dl>
542<dt>
Junio C Hamano4bf6dca2006-12-21 02:25:57543<em>set-tree</em>
Junio C Hamano9ae1a062006-07-10 08:12:34544</dt>
545<dd>
546<p>
Junio C Hamano43d01342006-10-12 04:07:32547 You should consider using <em>dcommit</em> instead of this command.
Junio C Hamano9ae1a062006-07-10 08:12:34548 Commit specified commit or tree objects to SVN. This relies on
549 your imported fetch data being up-to-date. This makes
550 absolutely no attempts to do patching when committing to SVN, it
551 simply overwrites files with those specified in the tree or
552 commit. All merging is assumed to have taken place
553 independently of git-svn functions.
554</p>
555</dd>
556<dt>
Junio C Hamano6b2cee12006-08-26 08:43:31557<em>show-ignore</em>
Junio C Hamano9ae1a062006-07-10 08:12:34558</dt>
559<dd>
560<p>
561 Recursively finds and lists the svn:ignore property on
562 directories. The output is suitable for appending to
563 the $GIT_DIR/info/exclude file.
564</p>
565</dd>
Junio C Hamano43d01342006-10-12 04:07:32566<dt>
567<em>commit-diff</em>
568</dt>
569<dd>
570<p>
571 Commits the diff of two tree-ish arguments from the
Junio C Hamanof9771f62007-01-17 17:42:30572 command-line. This command is intended for interoperability with
Junio C Hamano43d01342006-10-12 04:07:32573 git-svnimport and does not rely on being inside an git-svn
574 init-ed repository. This command takes three arguments, (a) the
575 original tree to diff against, (b) the new tree result, (c) the
576 URL of the target Subversion repository. The final argument
577 (URL) may be omitted if you are working from a git-svn-aware
578 repository (that has been init-ed with git-svn).
Junio C Hamano23db8852006-11-09 23:35:53579 The -r&lt;revision&gt; option is required for this.
Junio C Hamano43d01342006-10-12 04:07:32580</p>
581</dd>
Junio C Hamano9ae1a062006-07-10 08:12:34582</dl>
583</div>
584<h2>OPTIONS</h2>
585<div class="sectionbody">
586<dl>
587<dt>
Junio C Hamano00cb3712007-02-23 11:13:52588--shared[={false|true|umask|group|all|world|everybody}]
Junio C Hamano43d01342006-10-12 04:07:32589</dt>
590<dt>
591--template=&lt;template_directory&gt;
592</dt>
593<dd>
594<p>
595 Only used with the <em>init</em> command.
Junio C Hamano24351a82007-01-13 08:09:17596 These are passed directly to <a href="git-init.html">git-init(1)</a>.
Junio C Hamano43d01342006-10-12 04:07:32597</p>
598</dd>
599<dt>
Junio C Hamano9ae1a062006-07-10 08:12:34600-r &lt;ARG&gt;
601</dt>
602<dt>
603--revision &lt;ARG&gt;
604</dt>
605<dd>
606<p>
Junio C Hamano00cb3712007-02-23 11:13:52607Used with the <em>fetch</em> command.
Junio C Hamano9ae1a062006-07-10 08:12:34608</p>
Junio C Hamano00cb3712007-02-23 11:13:52609<p>This allows revision ranges for partial/cauterized history
610to be supported. $NUMBER, $NUMBER1:$NUMBER2 (numeric ranges),
611$NUMBER:HEAD, and BASE:$NUMBER are all supported.</p>
612<p>This can allow you to make partial mirrors when running fetch;
613but is generally not recommended because history will be skipped
614and lost.</p>
Junio C Hamano9ae1a062006-07-10 08:12:34615</dd>
616<dt>
617-
618</dt>
619<dt>
620--stdin
621</dt>
622<dd>
623<p>
Junio C Hamano4bf6dca2006-12-21 02:25:57624Only used with the <em>set-tree</em> command.
Junio C Hamano9ae1a062006-07-10 08:12:34625</p>
Junio C Hamano6b2cee12006-08-26 08:43:31626<p>Read a list of commits from stdin and commit them in reverse
Junio C Hamano9ae1a062006-07-10 08:12:34627order. Only the leading sha1 is read from each line, so
Junio C Hamano6b2cee12006-08-26 08:43:31628git-rev-list --pretty=oneline output can be used.</p>
Junio C Hamano9ae1a062006-07-10 08:12:34629</dd>
630<dt>
631--rmdir
632</dt>
633<dd>
634<p>
Junio C Hamano4bf6dca2006-12-21 02:25:57635Only used with the <em>dcommit</em>, <em>set-tree</em> and <em>commit-diff</em> commands.
Junio C Hamano9ae1a062006-07-10 08:12:34636</p>
Junio C Hamano6b2cee12006-08-26 08:43:31637<p>Remove directories from the SVN tree if there are no files left
Junio C Hamano9ae1a062006-07-10 08:12:34638behind. SVN can version empty directories, and they are not
639removed by default if there are no files left in them. git
640cannot version empty directories. Enabling this flag will make
Junio C Hamano6b2cee12006-08-26 08:43:31641the commit to SVN act like git.</p>
Junio C Hamano7ad22dc2007-01-29 02:55:48642<p>config key: svn.rmdir</p>
Junio C Hamano9ae1a062006-07-10 08:12:34643</dd>
644<dt>
645-e
646</dt>
647<dt>
648--edit
649</dt>
650<dd>
651<p>
Junio C Hamano4bf6dca2006-12-21 02:25:57652Only used with the <em>dcommit</em>, <em>set-tree</em> and <em>commit-diff</em> commands.
Junio C Hamano9ae1a062006-07-10 08:12:34653</p>
Junio C Hamano6b2cee12006-08-26 08:43:31654<p>Edit the commit message before committing to SVN. This is off by
Junio C Hamano9ae1a062006-07-10 08:12:34655default for objects that are commits, and forced on when committing
Junio C Hamano6b2cee12006-08-26 08:43:31656tree objects.</p>
Junio C Hamano7ad22dc2007-01-29 02:55:48657<p>config key: svn.edit</p>
Junio C Hamano9ae1a062006-07-10 08:12:34658</dd>
659<dt>
660-l&lt;num&gt;
661</dt>
662<dt>
663--find-copies-harder
664</dt>
665<dd>
666<p>
Junio C Hamano4bf6dca2006-12-21 02:25:57667Only used with the <em>dcommit</em>, <em>set-tree</em> and <em>commit-diff</em> commands.
Junio C Hamano9ae1a062006-07-10 08:12:34668</p>
Junio C Hamano6b2cee12006-08-26 08:43:31669<p>They are both passed directly to git-diff-tree see
670<a href="git-diff-tree.html">git-diff-tree(1)</a> for more information.</p>
671<div class="verseblock">
Junio C Hamano7ad22dc2007-01-29 02:55:48672<div class="content">config key: svn.l
673config key: svn.findcopiesharder</div></div>
Junio C Hamano9ae1a062006-07-10 08:12:34674</dd>
675<dt>
676-A&lt;filename&gt;
677</dt>
678<dt>
679--authors-file=&lt;filename&gt;
680</dt>
681<dd>
682<p>
Junio C Hamano6b2cee12006-08-26 08:43:31683Syntax is compatible with the files used by git-svnimport and
684git-cvsimport:
Junio C Hamano9ae1a062006-07-10 08:12:34685</p>
Junio C Hamano9ae1a062006-07-10 08:12:34686<div class="listingblock">
687<div class="content">
Junio C Hamano6b2cee12006-08-26 08:43:31688<pre><tt> loginname = Joe User &lt;user@example.com&gt;</tt></pre>
Junio C Hamano9ae1a062006-07-10 08:12:34689</div></div>
Junio C Hamano6b2cee12006-08-26 08:43:31690<p>If this option is specified and git-svn encounters an SVN
Junio C Hamano9ae1a062006-07-10 08:12:34691committer name that does not exist in the authors-file, git-svn
692will abort operation. The user will then have to add the
693appropriate entry. Re-running the previous git-svn command
Junio C Hamano6b2cee12006-08-26 08:43:31694after the authors-file is modified should continue operation.</p>
Junio C Hamano7ad22dc2007-01-29 02:55:48695<p>config key: svn.authorsfile</p>
Junio C Hamano43d01342006-10-12 04:07:32696</dd>
697<dt>
698-q
699</dt>
700<dt>
701--quiet
702</dt>
703<dd>
704<p>
Junio C Hamanodeab0362007-01-10 05:05:11705 Make git-svn less verbose.
Junio C Hamano43d01342006-10-12 04:07:32706</p>
707</dd>
708<dt>
709--repack[=&lt;n&gt;]
710</dt>
Junio C Hamanoa3fd83c2007-03-02 10:34:36711<dt>
712--repack-flags=&lt;flags&gt;
713</dt>
Junio C Hamano43d01342006-10-12 04:07:32714<dd>
715<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:36716These should help keep disk usage sane for large fetches
717with many revisions.
Junio C Hamano43d01342006-10-12 04:07:32718</p>
Junio C Hamanoa3fd83c2007-03-02 10:34:36719<p>--repack takes an optional argument for the number of revisions
Junio C Hamano43d01342006-10-12 04:07:32720to fetch before repacking. This defaults to repacking every
Junio C Hamanoa3fd83c2007-03-02 10:34:367211000 commits fetched if no argument is specified.</p>
722<p>--repack-flags are passed directly to <a href="git-repack.html">git-repack(1)</a>.</p>
723<div class="verseblock">
724<div class="content">config key: svn.repack
725config key: svn.repackflags</div></div>
Junio C Hamano6b2cee12006-08-26 08:43:31726</dd>
727<dt>
728-m
729</dt>
730<dt>
731--merge
732</dt>
733<dt>
734-s&lt;strategy&gt;
735</dt>
736<dt>
737--strategy=&lt;strategy&gt;
738</dt>
739<dd>
740<p>
Junio C Hamano00cb3712007-02-23 11:13:52741These are only used with the <em>dcommit</em> and <em>rebase</em> commands.
Junio C Hamano6b2cee12006-08-26 08:43:31742</p>
743<p>Passed directly to git-rebase when using <em>dcommit</em> if a
744<em>git-reset</em> cannot be used (see dcommit).</p>
745</dd>
746<dt>
747-n
748</dt>
749<dt>
750--dry-run
751</dt>
752<dd>
753<p>
754This is only used with the <em>dcommit</em> command.
755</p>
756<p>Print out the series of git arguments that would show
757which diffs would be committed to SVN.</p>
758</dd>
759</dl>
Junio C Hamano9ae1a062006-07-10 08:12:34760</div>
761<h2>ADVANCED OPTIONS</h2>
762<div class="sectionbody">
763<dl>
764<dt>
Junio C Hamano9ae1a062006-07-10 08:12:34765-i&lt;GIT_SVN_ID&gt;
766</dt>
767<dt>
768--id &lt;GIT_SVN_ID&gt;
769</dt>
770<dd>
771<p>
Junio C Hamano00cb3712007-02-23 11:13:52772This sets GIT_SVN_ID (instead of using the environment). This
773allows the user to override the default refname to fetch from
774when tracking a single URL. The <em>log</em> and <em>dcommit</em> commands
775no longer require this switch as an argument.
776</p>
777</dd>
778<dt>
779-R&lt;remote name&gt;
780</dt>
781<dt>
782--svn-remote &lt;remote name&gt;
783</dt>
784<dd>
785<p>
786 Specify the [svn-remote "&lt;remote name&gt;"] section to use,
787 this allows SVN multiple repositories to be tracked.
788 Default: "svn"
Junio C Hamano9ae1a062006-07-10 08:12:34789</p>
790</dd>
Junio C Hamano43d01342006-10-12 04:07:32791<dt>
792--follow-parent
793</dt>
794<dd>
795<p>
796 This is especially helpful when we're tracking a directory
797 that has been moved around within the repository, or if we
798 started tracking a branch and never tracked the trunk it was
Junio C Hamano00cb3712007-02-23 11:13:52799 descended from. This feature is enabled by default, use
800 --no-follow-parent to disable it.
Junio C Hamano43d01342006-10-12 04:07:32801</p>
Junio C Hamano7ad22dc2007-01-29 02:55:48802<p>config key: svn.followparent</p>
Junio C Hamano43d01342006-10-12 04:07:32803</dd>
Junio C Hamano00cb3712007-02-23 11:13:52804</dl>
805</div>
806<h2>CONFIG FILE-ONLY OPTIONS</h2>
807<div class="sectionbody">
808<dl>
Junio C Hamano43d01342006-10-12 04:07:32809<dt>
Junio C Hamano00cb3712007-02-23 11:13:52810svn.noMetadata
811</dt>
812<dt>
813svn-remote.&lt;name&gt;.noMetadata
Junio C Hamano43d01342006-10-12 04:07:32814</dt>
815<dd>
816<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:36817This gets rid of the git-svn-id: lines at the end of every commit.
Junio C Hamano43d01342006-10-12 04:07:32818</p>
Junio C Hamanoa3fd83c2007-03-02 10:34:36819<p>If you lose your .git/svn/git-svn/.rev_db file, git-svn will not
Junio C Hamano00cb3712007-02-23 11:13:52820be able to rebuild it and you won't be able to fetch again,
Junio C Hamanoa3fd83c2007-03-02 10:34:36821either. This is fine for one-shot imports.</p>
822<p>The <em>git-svn log</em> command will not work on repositories using
823this, either. Using this conflicts with the <em>useSvmProps</em>
824option for (hopefully) obvious reasons.</p>
Junio C Hamano43d01342006-10-12 04:07:32825</dd>
Junio C Hamano9ae1a062006-07-10 08:12:34826<dt>
Junio C Hamano00cb3712007-02-23 11:13:52827svn.useSvmProps
828</dt>
829<dt>
830svn-remote.&lt;name&gt;.useSvmProps
Junio C Hamano9ae1a062006-07-10 08:12:34831</dt>
832<dd>
833<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:36834This allows git-svn to re-map repository URLs and UUIDs from
835mirrors created using SVN::Mirror (or svk) for metadata.
Junio C Hamano9ae1a062006-07-10 08:12:34836</p>
Junio C Hamanoa3fd83c2007-03-02 10:34:36837<p>If an SVN revision has a property, "svm:headrev", it is likely
Junio C Hamano00cb3712007-02-23 11:13:52838that the revision was created by SVN::Mirror (also used by SVK).
839The property contains a repository UUID and a revision. We want
840to make it look like we are mirroring the original URL, so
841introduce a helper function that returns the original identity
842URL and UUID, and use it when generating metadata in commit
Junio C Hamanoa3fd83c2007-03-02 10:34:36843messages.</p>
Junio C Hamano9ae1a062006-07-10 08:12:34844</dd>
845<dt>
Junio C Hamano00cb3712007-02-23 11:13:52846svn.useSvnsyncProps
847</dt>
848<dt>
849svn-remote.&lt;name&gt;.useSvnsyncprops
Junio C Hamano47c1e3c2006-09-25 04:45:55850</dt>
851<dd>
852<p>
Junio C Hamano00cb3712007-02-23 11:13:52853 Similar to the useSvmProps option; this is for users
854 of the svnsync(1) command distributed with SVN 1.4.x and
855 later.
Junio C Hamano47c1e3c2006-09-25 04:45:55856</p>
Junio C Hamano00cb3712007-02-23 11:13:52857</dd>
858<dt>
859svn-remote.&lt;name&gt;.rewriteRoot
860</dt>
861<dd>
862<p>
863 This allows users to create repositories from alternate
864 URLs. For example, an administrator could run git-svn on the
865 server locally (accessing via file://) but wish to distribute
866 the repository with a public http:// or svn:// URL in the
867 metadata so users of it will see the public URL.
868</p>
869<p>Since the noMetadata, rewriteRoot, useSvnsyncProps and useSvmProps
870options all affect the metadata generated and used by git-svn; they
871<strong>must</strong> be set in the configuration file before any history is imported
872and these settings should never be changed once they are set.</p>
873<p>Additionally, only one of these four options can be used per-svn-remote
874section because they affect the <em>git-svn-id:</em> metadata line.</p>
Junio C Hamano47c1e3c2006-09-25 04:45:55875</dd>
Junio C Hamano9ae1a062006-07-10 08:12:34876</dl>
Junio C Hamanoa3fd83c2007-03-02 10:34:36877</div>
878<h2>BASIC EXAMPLES</h2>
879<div class="sectionbody">
Junio C Hamanoa8d072a2007-01-05 07:46:25880<p>Tracking and contributing to a the trunk of a Subversion-managed project:</p>
Junio C Hamano9ae1a062006-07-10 08:12:34881<div class="listingblock">
882<div class="content">
Junio C Hamano00cb3712007-02-23 11:13:52883<pre><tt># Clone a repo (like git clone):
884 git-svn clone http://svn.foo.org/project/trunk
885# Enter the newly cloned directory:
886 cd trunk
887# You should be on master branch, double-check with git-branch
888 git branch
889# Do some work and commit locally to git:
890 git commit ...
891# Something is committed to SVN, rebase your local changes against the
892# latest changes in SVN:
893 git-svn rebase
894# Now commit your changes (that were committed previously using git) to SVN,
895# as well as automatically updating your working HEAD:
Junio C Hamanoa3e46262006-11-29 07:59:40896 git-svn dcommit
Junio C Hamano9ae1a062006-07-10 08:12:34897# Append svn:ignore settings to the default git exclude file:
898 git-svn show-ignore &gt;&gt; .git/info/exclude</tt></pre>
899</div></div>
Junio C Hamanoa8d072a2007-01-05 07:46:25900<p>Tracking and contributing to an entire Subversion-managed project
Junio C Hamano00cb3712007-02-23 11:13:52901(complete with a trunk, tags and branches):</p>
Junio C Hamanoa8d072a2007-01-05 07:46:25902<div class="listingblock">
903<div class="content">
Junio C Hamano00cb3712007-02-23 11:13:52904<pre><tt># Clone a repo (like git clone):
905 git-svn clone http://svn.foo.org/project -T trunk -b branches -t tags
906# View all branches and tags you have cloned:
907 git branch -r
908# Reset your master to trunk (or any other branch, replacing 'trunk'
909# with the appropriate name):
910 git reset --hard remotes/trunk
911# You may only dcommit to one branch/tag/trunk at a time. The usage
Junio C Hamanoa3fd83c2007-03-02 10:34:36912# of dcommit/rebase/show-ignore should be the same as above.</tt></pre>
Junio C Hamanoa8d072a2007-01-05 07:46:25913</div></div>
Junio C Hamano9ae1a062006-07-10 08:12:34914</div>
Junio C Hamano79770b62007-01-07 07:43:58915<h2>REBASE VS. PULL/MERGE</h2>
Junio C Hamano6b2cee12006-08-26 08:43:31916<div class="sectionbody">
917<p>Originally, git-svn recommended that the remotes/git-svn branch be
Junio C Hamano79770b62007-01-07 07:43:58918pulled or merged from. This is because the author favored
919<em>git-svn set-tree B</em> to commit a single head rather than the
920<em>git-svn set-tree A..B</em> notation to commit multiple commits.</p>
921<p>If you use <em>git-svn set-tree A..B</em> to commit several diffs and you do
922not have the latest remotes/git-svn merged into my-branch, you should
Junio C Hamano00cb3712007-02-23 11:13:52923use <em>git-svn rebase</em> to update your work branch instead of <em>git pull</em> or
Junio C Hamano79770b62007-01-07 07:43:58924<em>git merge</em>. <em>pull/merge</em> can cause non-linear history to be flattened
925when committing into SVN, which can lead to merge commits reversing
926previous commits in SVN.</p>
Junio C Hamano6b2cee12006-08-26 08:43:31927</div>
Junio C Hamano9ae1a062006-07-10 08:12:34928<h2>DESIGN PHILOSOPHY</h2>
929<div class="sectionbody">
930<p>Merge tracking in Subversion is lacking and doing branched development
Junio C Hamanoa3e46262006-11-29 07:59:40931with Subversion is cumbersome as a result. git-svn does not do
932automated merge/branch tracking by default and leaves it entirely up to
Junio C Hamano00cb3712007-02-23 11:13:52933the user on the git side. git-svn does however follow copy
934history of the directory that it is tracking, however (much like
935how <em>svn log</em> works).</p>
Junio C Hamano9ae1a062006-07-10 08:12:34936</div>
937<h2>BUGS</h2>
938<div class="sectionbody">
Junio C Hamano00cb3712007-02-23 11:13:52939<p>We ignore all SVN properties except svn:executable. Any unhandled
940properties are logged to $GIT_DIR/svn/&lt;refname&gt;/unhandled.log</p>
Junio C Hamano9ae1a062006-07-10 08:12:34941<p>Renamed and copied directories are not detected by git and hence not
942tracked when committing to SVN. I do not plan on adding support for
943this as it's quite difficult and time-consuming to get working for all
Junio C Hamano00cb3712007-02-23 11:13:52944the possible corner cases (git doesn't do it, either). Committing
945renamed and copied files are fully supported if they're similar enough
946for git to detect them.</p>
947</div>
948<h2>CONFIGURATION</h2>
949<div class="sectionbody">
950<p>git-svn stores [svn-remote] configuration information in the
951repository .git/config file. It is similar the core git
952[remote] sections except <em>fetch</em> keys do not accept glob
953arguments; but they are instead handled by the <em>branches</em>
954and <em>tags</em> keys. Since some SVN repositories are oddly
955configured with multiple projects glob expansions such those
956listed below are allowed:</p>
957<div class="listingblock">
958<div class="content">
959<pre><tt>[svn-remote "project-a"]
960 url = http://server.org/svn
961 branches = branches/*/project-a:refs/remotes/project-a/branches/*
962 tags = tags/*/project-a:refs/remotes/project-a/tags/*
963 trunk = trunk/project-a:refs/remotes/project-a/trunk</tt></pre>
964</div></div>
965<p>Keep in mind that the <em><strong></em> (asterisk) wildcard of the local ref
966(left of the <em>:</em>) *must</strong> be the farthest right path component;
967however the remote wildcard may be anywhere as long as it's own
968independent path componet (surrounded by <em>/</em> or EOL). This
969type of configuration is not automatically created by <em>init</em> and
970should be manually entered with a text-editor or using
971<a href="git-config.html">git-config(1)</a></p>
Junio C Hamano9ae1a062006-07-10 08:12:34972</div>
Junio C Hamano6b2cee12006-08-26 08:43:31973<h2>SEE ALSO</h2>
974<div class="sectionbody">
975<p><a href="git-rebase.html">git-rebase(1)</a></p>
976</div>
Junio C Hamano9ae1a062006-07-10 08:12:34977<h2>Author</h2>
978<div class="sectionbody">
979<p>Written by Eric Wong &lt;normalperson@yhbt.net&gt;.</p>
980</div>
981<h2>Documentation</h2>
982<div class="sectionbody">
983<p>Written by Eric Wong &lt;normalperson@yhbt.net&gt;.</p>
984</div>
985<div id="footer">
986<div id="footer-text">
Junio C Hamano103ad7f2007-03-14 11:19:26987Last updated 14-Mar-2007 11:19:13 UTC
Junio C Hamano9ae1a062006-07-10 08:12:34988</div>
989</div>
990</body>
991</html>