1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3 <html xmlns=
"http://www.w3.org/1999/xhtml" xml:
lang=
"en">
5 <meta http-equiv=
"Content-Type" content=
"text/html; charset=UTF-8" />
6 <meta name=
"generator" content=
"AsciiDoc 8.5.2" />
7 <title>git-svn(
1)
</title>
8 <style type=
"text/css">
10 p
, li
, dt
, dd
, div
, pre
, h1
, h2
, h3
, h4
, h5
, h6
{
12 border: 1px solid red;
17 margin: 1em 5% 1em 5%;
22 text-decoration: underline
;
42 h1
, h2
, h3
, h4
, h5
, h6
{
44 font-family: sans-serif
;
51 border-bottom: 2px solid silver
;
69 border: 1px solid silver
;
88 font-family: sans-serif
;
94 span#revnumber
, span#revdate
, span#revremark
{
95 font-family: sans-serif
;
99 font-family: sans-serif
;
101 border-top: 2px solid silver
;
107 padding-bottom: 0.5em;
111 padding-bottom: 0.5em;
116 margin-bottom: 1.5em;
118 div
.tableblock
, div
.imageblock
, div
.exampleblock
, div
.verseblock
,
119 div
.quoteblock
, div
.literalblock
, div
.listingblock
, div
.sidebarblock
,
120 div
.admonitionblock
{
122 margin-bottom: 1.5em;
124 div
.admonitionblock
{
126 margin-bottom: 2.0em;
131 div
.content
{ /* Block element content. */
135 /* Block element titles. */
136 div
.title
, caption
.title
{
138 font-family: sans-serif
;
142 margin-bottom: 0.5em;
148 td div
.title:first-child
{
151 div
.content div
.title:first-child
{
154 div
.content
+ div
.title
{
158 div
.sidebarblock
> div
.content
{
160 border: 1px solid silver
;
164 div
.listingblock
> div
.content
{
165 border: 1px solid silver
;
170 div
.quoteblock
, div
.verseblock
{
174 border-left: 5px solid
#dddddd;
178 div
.quoteblock
> div
.attribution
{
183 div
.verseblock
> div
.content
{
186 div
.verseblock
> div
.attribution
{
190 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
191 div
.verseblock
+ div
.attribution
{
195 div
.admonitionblock
.icon
{
199 text-decoration: underline
;
201 padding-right: 0.5em;
203 div
.admonitionblock td
.content
{
205 border-left: 3px solid
#dddddd;
208 div
.exampleblock
> div
.content
{
209 border-left: 3px solid
#dddddd;
213 div
.imageblock div
.content
{ padding-left: 0; }
214 span
.image img
{ border-style: none
; }
215 a
.image:visited
{ color: white
; }
219 margin-bottom: 0.8em;
232 list-style-position: outside
;
235 list-style-type: decimal
;
238 list-style-type: lower-alpha
;
241 list-style-type: upper-alpha
;
244 list-style-type: lower-roman
;
247 list-style-type: upper-roman
;
250 div
.compact ul
, div
.compact ol
,
251 div
.compact p
, div
.compact p
,
252 div
.compact div
, div
.compact div
{
254 margin-bottom: 0.1em;
257 div
.tableblock
> table
{
258 border: 3px solid
#527bbd;
260 thead
, p
.table
.header
{
261 font-family: sans-serif
;
273 /* Because the table frame attribute is overriden by CSS in most browsers. */
274 div
.tableblock
> table
[frame
="void"] {
277 div
.tableblock
> table
[frame
="hsides"] {
278 border-left-style: none
;
279 border-right-style: none
;
281 div
.tableblock
> table
[frame
="vsides"] {
282 border-top-style: none
;
283 border-bottom-style: none
;
289 margin-bottom: 0.8em;
292 padding-bottom: 15px;
294 dt
.hdlist1
.strong
, td
.hdlist1
.strong
{
300 padding-right: 0.8em;
306 div
.hdlist
.compact tr
{
315 .footnote, .footnoteref {
319 span
.footnote
, span
.footnoteref
{
320 vertical-align: super
;
324 margin: 20px 0 20px 0;
328 #footnotes div
.footnote
{
334 border-top: 1px solid silver
;
344 div#footer-badges
{ display: none
; }
348 margin-bottom: 2.5em;
353 font-family: sans-serif
;
357 margin-bottom: 0.1em;
360 div
.toclevel1
, div
.toclevel2
, div
.toclevel3
, div
.toclevel4
{
376 /* Overrides for manpage documents */
379 padding-bottom: 0.5em;
380 border-top: 2px solid silver
;
381 border-bottom: 2px solid silver
;
391 div#toc
{ display: none
; }
394 /* Workarounds for IE6's broken and incomplete CSS2. */
396 div
.sidebar-content
{
398 border: 1px solid silver
;
401 div
.sidebar-title
, div
.image-title
{
403 font-family: sans-serif
;
406 margin-bottom: 0.5em;
409 div
.listingblock div
.content
{
410 border: 1px solid silver
;
415 div
.quoteblock-attribution
{
420 div
.verseblock-content
{
423 div
.verseblock-attribution
{
428 div
.exampleblock-content
{
429 border-left: 3px solid
#dddddd;
433 /* IE6 sets dynamically generated links as visited. */
434 div#toc
a:visited
{ color: blue
; }
436 <script type=
"text/javascript">
438 window
.onload = function(){asciidoc
.footnotes();}
439 var asciidoc
= { // Namespace.
441 /////////////////////////////////////////////////////////////////////
442 // Table Of Contents generator
443 /////////////////////////////////////////////////////////////////////
445 /* Author: Mihai Bazon, September 2002
446 * http://students.infoiasi.ro/~mishoo
448 * Table Of Content generator
451 * Feel free to use this script under the terms of the GNU General Public
452 * License, as long as you do not remove or alter this notice.
455 /* modified by Troy D. Hanson, September 2006. License: GPL */
456 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
459 toc: function (toclevels
) {
461 function getText(el
) {
463 for (var i
= el
.firstChild
; i
!= null; i
= i
.nextSibling
) {
464 if (i
.nodeType
== 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
466 else if (i
.firstChild
!= null)
472 function TocEntry(el
, text
, toclevel
) {
475 this.toclevel
= toclevel
;
478 function tocEntries(el
, toclevels
) {
479 var result
= new Array
;
480 var re
= new RegExp('[hH]([2-'+(toclevels
+1)+'])');
481 // Function that scans the DOM tree for header elements (the DOM2
482 // nodeIterator API would be a better technique but not supported by all
484 var iterate = function (el
) {
485 for (var i
= el
.firstChild
; i
!= null; i
= i
.nextSibling
) {
486 if (i
.nodeType
== 1 /* Node.ELEMENT_NODE */) {
487 var mo
= re
.exec(i
.tagName
);
488 if (mo
&& (i
.getAttribute("class") || i
.getAttribute("className")) != "float") {
489 result
[result
.length
] = new TocEntry(i
, getText(i
), mo
[1]-1);
499 var toc
= document
.getElementById("toc");
500 var entries
= tocEntries(document
.getElementById("content"), toclevels
);
501 for (var i
= 0; i
< entries
.length
; ++i
) {
502 var entry
= entries
[i
];
503 if (entry
.element
.id
== "")
504 entry
.element
.id
= "_toc_" + i
;
505 var a
= document
.createElement("a");
506 a
.href
= "#" + entry
.element
.id
;
507 a
.appendChild(document
.createTextNode(entry
.text
));
508 var div
= document
.createElement("div");
510 div
.className
= "toclevel" + entry
.toclevel
;
511 toc
.appendChild(div
);
513 if (entries
.length
== 0)
514 toc
.parentNode
.removeChild(toc
);
518 /////////////////////////////////////////////////////////////////////
519 // Footnotes generator
520 /////////////////////////////////////////////////////////////////////
522 /* Based on footnote generation code from:
523 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
526 footnotes: function () {
527 var cont
= document
.getElementById("content");
528 var noteholder
= document
.getElementById("footnotes");
529 var spans
= cont
.getElementsByTagName("span");
532 for (i
=0; i
<spans
.length
; i
++) {
533 if (spans
[i
].className
== "footnote") {
535 // Use [\s\S] in place of . so multi-line matches work.
536 // Because JavaScript has no s (dotall) regex flag.
537 note
= spans
[i
].innerHTML
.match(/\s*\[([\s\S]*)]\s*/)[1];
538 noteholder
.innerHTML
+=
539 "<div class='footnote' id='_footnote_" + n
+ "'>" +
540 "<a href='#_footnoteref_" + n
+ "' title='Return to text'>" +
541 n
+ "</a>. " + note
+ "</div>";
543 "[<a id='_footnoteref_" + n
+ "' href='#_footnote_" + n
+
544 "' title='View footnote' class='footnote'>" + n
+ "</a>]";
545 var id
=spans
[i
].getAttribute("id");
546 if (id
!= null) refs
["#"+id
] = n
;
550 noteholder
.parentNode
.removeChild(noteholder
);
552 // Process footnoterefs.
553 for (i
=0; i
<spans
.length
; i
++) {
554 if (spans
[i
].className
== "footnoteref") {
555 var href
= spans
[i
].getElementsByTagName("a")[0].getAttribute("href");
556 href
= href
.match(/#.*/)[0]; // Because IE return full URL.
559 "[<a href='#_footnote_" + n
+
560 "' title='View footnote' class='footnote'>" + n
+ "</a>]";
573 git-svn(
1) Manual Page
576 <div class=
"sectionbody">
578 Bidirectional operation between a Subversion repository and git
583 <h2 id=
"_synopsis">SYNOPSIS
</h2>
584 <div class=
"sectionbody">
585 <div class=
"verseblock">
586 <div class=
"verseblock-content"><em>git svn
</em> <command
> [options] [arguments]
</div>
587 <div class=
"verseblock-attribution">
590 <h2 id=
"_description">DESCRIPTION
</h2>
591 <div class=
"sectionbody">
592 <div class=
"paragraph"><p><em>git svn
</em> is a simple conduit for changesets between Subversion and git.
593 It provides a bidirectional flow of changes between a Subversion and a git
594 repository.
</p></div>
595 <div class=
"paragraph"><p><em>git svn
</em> can track a standard Subversion repository,
596 following the common
"trunk/branches/tags" layout, with the --stdlayout option.
597 It can also follow branches and tags in any layout with the -T/-t/-b options
598 (see options to
<em>init
</em> below, and also the
<em>clone
</em> command).
</p></div>
599 <div class=
"paragraph"><p>Once tracking a Subversion repository (with any of the above methods), the git
600 repository can be updated from Subversion by the
<em>fetch
</em> command and
601 Subversion updated from git by the
<em>dcommit
</em> command.
</p></div>
603 <h2 id=
"_commands">COMMANDS
</h2>
604 <div class=
"sectionbody">
605 <div class=
"dlist"><dl>
611 Initializes an empty git repository with additional
612 metadata directories for
<em>git svn
</em>. The Subversion URL
613 may be specified as a command-line argument, or as full
614 URL arguments to -T/-t/-b. Optionally, the target
615 directory to operate on can be specified as a second
616 argument. Normally this command initializes the current
619 <div class=
"dlist"><dl>
621 -T
<trunk_subdir
>
624 --trunk=
<trunk_subdir
>
627 -t
<tags_subdir
>
630 --tags=
<tags_subdir
>
633 -b
<branches_subdir
>
636 --branches=
<branches_subdir
>
646 These are optional command-line options for init. Each of
647 these flags can point to a relative repository path
648 (--tags=project/tags) or a full url
649 (--tags=https://foo.org/project/tags).
650 You can specify more than one --tags and/or --branches options, in case
651 your Subversion repository places tags or branches under multiple paths.
652 The option --stdlayout is
653 a shorthand way of setting trunk,tags,branches as the relative paths,
654 which is the Subversion default. If any of the other options are given
655 as well, they take precedence.
663 Set the
<em>noMetadata
</em> option in the [svn-remote] config.
664 This option is not recommended, please read the
<em>svn.noMetadata
</em>
665 section of this manpage before using this option.
673 Set the
<em>useSvmProps
</em> option in the [svn-remote] config.
681 Set the
<em>useSvnsyncProps
</em> option in the [svn-remote] config.
685 --rewrite-root=
<URL
>
689 Set the
<em>rewriteRoot
</em> option in the [svn-remote] config.
693 --rewrite-uuid=
<UUID
>
697 Set the
<em>rewriteUUID
</em> option in the [svn-remote] config.
701 --username=
<user
>
705 For transports that SVN handles authentication for (http,
706 https, and plain svn), specify the username. For other
707 transports (eg svn+ssh://), you must include the username in
708 the URL, eg svn+ssh://foo@svn.bar.com/project
712 --prefix=
<prefix
>
716 This allows one to specify a prefix which is prepended
717 to the names of remotes if trunk/branches/tags are
718 specified. The prefix does not automatically include a
719 trailing slash, so be sure you include one in the
720 argument if that is what you want. If --branches/-b is
721 specified, the prefix must include a trailing slash.
722 Setting a prefix is useful if you wish to track multiple
723 projects that share a common repository.
727 --ignore-paths=
<regex
>
731 When passed to
<em>init
</em> or
<em>clone
</em> this regular expression will
732 be preserved as a config key. See
<em>fetch
</em> for a description
733 of
<em>--ignore-paths
</em>.
741 When tracking multiple directories (using --stdlayout,
742 --branches, or --tags options), git svn will attempt to connect
743 to the root (or highest allowed level) of the Subversion
744 repository. This default allows better tracking of history if
745 entire projects are moved within a repository, but may cause
746 issues on repositories where read access restrictions are in
747 place. Passing
<em>--no-minimize-url
</em> will allow git svn to
748 accept URLs as-is without attempting to connect to a higher
749 level directory. This option is off by default when only
750 one URL/branch is tracked (it would do little good).
760 Fetch unfetched revisions from the Subversion remote we are
761 tracking. The name of the [svn-remote
"…"] section in the
762 .git/config file may be specified as an optional command-line
765 <div class=
"dlist"><dl>
771 Store Git commit times in the local timezone instead of UTC. This
772 makes
<em>git log
</em> (even without --date=local) show the same times
773 that
<tt>svn log
</tt> would in the local timezone.
775 <div class=
"paragraph"><p>This doesn
’t interfere with interoperating with the Subversion
776 repository you cloned from, but if you wish for your local Git
777 repository to be able to interoperate with someone else
’s local Git
778 repository, either don
’t use this option or you should both use it in
779 the same local timezone.
</p></div>
786 Fetch only from the SVN parent of the current HEAD.
790 --ignore-paths=
<regex
>
794 This allows one to specify a Perl regular expression that will
795 cause skipping of all matching paths from checkout from SVN.
796 The
<em>--ignore-paths
</em> option should match for every
<em>fetch
</em>
797 (including automatic fetches due to
<em>clone
</em>,
<em>dcommit
</em>,
798 <em>rebase
</em>, etc) on a given repository.
800 <div class=
"verseblock">
801 <div class=
"verseblock-content">config key: svn-remote.
<name
>.ignore-paths
</div>
802 <div class=
"verseblock-attribution">
804 <div class=
"paragraph"><p>If the ignore-paths config key is set and the command line option is
805 also given, both regular expressions will be used.
</p></div>
806 <div class=
"paragraph"><p>Examples:
</p></div>
807 <div class=
"dlist"><dl>
809 Skip
"doc*" directory for every fetch
812 <div class=
"listingblock">
813 <div class=
"content">
814 <pre><tt>--ignore-paths=
"^doc"</tt></pre>
818 Skip
"branches" and
"tags" of first level directories
821 <div class=
"listingblock">
822 <div class=
"content">
823 <pre><tt>--ignore-paths=
"^[^/]+/(?:branches|tags)"</tt></pre>
835 Runs
<em>init
</em> and
<em>fetch
</em>. It will automatically create a
836 directory based on the basename of the URL passed to it;
837 or if a second argument is passed; it will create a directory
838 and work within that. It accepts all arguments that the
839 <em>init
</em> and
<em>fetch
</em> commands accept; with the exception of
840 <em>--fetch-all
</em> and
<em>--parent
</em>. After a repository is cloned,
841 the
<em>fetch
</em> command will be able to update revisions without
842 affecting the working tree; and the
<em>rebase
</em> command will be
843 able to update the working tree with the latest changes.
845 <div class=
"dlist"><dl>
847 --preserve-empty-dirs
851 Create a placeholder file in the local Git repository for each
852 empty directory fetched from Subversion. This includes directories
853 that become empty by removing all entries in the Subversion
854 repository (but not the directory itself). The placeholder files
855 are also tracked and removed when no longer necessary.
859 --placeholder-filename=
<filename
>
863 Set the name of placeholder files created by --preserve-empty-dirs.
864 Default:
".gitignore"
874 This fetches revisions from the SVN parent of the current HEAD
875 and rebases the current (uncommitted to SVN) work against it.
877 <div class=
"paragraph"><p>This works similarly to
<tt>svn update
</tt> or
<em>git pull
</em> except that
878 it preserves linear history with
<em>git rebase
</em> instead of
879 <em>git merge
</em> for ease of dcommitting with
<em>git svn
</em>.
</p></div>
880 <div class=
"paragraph"><p>This accepts all options that
<em>git svn fetch
</em> and
<em>git rebase
</em>
881 accept. However,
<em>--fetch-all
</em> only fetches from the current
882 [svn-remote], and not all [svn-remote] definitions.
</p></div>
883 <div class=
"paragraph"><p>Like
<em>git rebase
</em>; this requires that the working tree be clean
884 and have no uncommitted changes.
</p></div>
885 <div class=
"dlist"><dl>
894 Do not fetch remotely; only run
<em>git rebase
</em> against the
895 last fetched commit from the upstream SVN.
905 Commit each diff from a specified head directly to the SVN
906 repository, and then rebase or reset (depending on whether or
907 not there is a diff between SVN and head). This will create
908 a revision in SVN for each commit in git.
909 It is recommended that you run
<em>git svn
</em> fetch and rebase (not
910 pull or merge) your commits against the latest changes in the
912 An optional revision or branch argument may be specified, and
913 causes
<em>git svn
</em> to do all work on that revision/branch
915 This is advantageous over
<em>set-tree
</em> (below) because it produces
916 cleaner, more linear history.
918 <div class=
"dlist"><dl>
924 After committing, do not rebase or reset.
928 --commit-url
<URL
>
932 Commit to this SVN URL (the full path). This is intended to
933 allow existing
<em>git svn
</em> repositories created with one transport
934 method (e.g.
<tt>svn://
</tt> or
<tt>http://
</tt> for anonymous read) to be
935 reused if a user is later given access to an alternate transport
936 method (e.g.
<tt>svn+ssh://
</tt> or
<tt>https://
</tt>) for commit.
938 <div class=
"verseblock">
939 <div class=
"verseblock-content">config key: svn-remote.
<name
>.commiturl
940 config key: svn.commiturl (overwrites all svn-remote.
<name
>.commiturl options)
</div>
941 <div class=
"verseblock-attribution">
943 <div class=
"paragraph"><p>Using this option for any other purpose (don
’t ask) is very strongly
944 discouraged.
</p></div>
947 --mergeinfo=
<mergeinfo
>
951 Add the given merge information during the dcommit
952 (e.g.
<tt>--mergeinfo=
"/branches/foo:1-10"</tt>). All svn server versions can
953 store this information (as a property), and svn clients starting from
954 version
1.5 can make use of it. To specify merge information from multiple
955 branches, use a single space character between the branches
956 (
<tt>--mergeinfo=
"/branches/foo:1-10 /branches/bar:3,5-6,8"</tt>)
958 <div class=
"verseblock">
959 <div class=
"verseblock-content">config key: svn.pushmergeinfo
</div>
960 <div class=
"verseblock-attribution">
962 <div class=
"paragraph"><p>This option will cause git-svn to attempt to automatically populate the
963 svn:mergeinfo property in the SVN repository when possible. Currently, this can
964 only be done when dcommitting non-fast-forward merges where all parents but the
965 first have already been pushed into SVN.
</p></div>
974 Create a branch in the SVN repository.
976 <div class=
"dlist"><dl>
985 Allows to specify the commit message.
996 Create a tag by using the tags_subdir instead of the branches_subdir
997 specified during git svn init.
1000 <dt class=
"hdlist1">
1003 <dt class=
"hdlist1">
1008 If more than one --branches (or --tags) option was given to the
<em>init
</em>
1009 or
<em>clone
</em> command, you must provide the location of the branch (or
1010 tag) you wish to create in the SVN repository. The value of this
1011 option must match one of the paths specified by a --branches (or
1012 --tags) option. You can see these paths with the commands
1014 <div class=
"literalblock">
1015 <div class=
"content">
1016 <pre><tt>git config --get-all svn-remote.
<name
>.branches
1017 git config --get-all svn-remote.
<name
>.tags
</tt></pre>
1019 <div class=
"paragraph"><p>where
<name
> is the name of the SVN repository as specified by the -R option to
1020 <em>init
</em> (or
"svn" by default).
</p></div>
1022 <dt class=
"hdlist1">
1027 Specify the SVN username to perform the commit as. This option overrides
1028 the
<em>username
</em> configuration property.
1031 <dt class=
"hdlist1">
1036 Use the specified URL to connect to the destination Subversion
1037 repository. This is useful in cases where the source SVN
1038 repository is read-only. This option overrides configuration
1039 property
<em>commiturl
</em>.
1041 <div class=
"literalblock">
1042 <div class=
"content">
1043 <pre><tt>git config --get-all svn-remote.
<name
>.commiturl
</tt></pre>
1048 <dt class=
"hdlist1">
1053 Create a tag in the SVN repository. This is a shorthand for
1057 <dt class=
"hdlist1">
1062 This should make it easy to look up svn log messages when svn
1063 users refer to -r/--revision numbers.
1065 <div class=
"paragraph"><p>The following features from
‘svn log
’ are supported:
</p></div>
1066 <div class=
"dlist"><dl>
1067 <dt class=
"hdlist1">
1068 -r
<n
>[:
<n
>]
1070 <dt class=
"hdlist1">
1071 --revision=
<n
>[:
<n
>]
1075 is supported, non-numeric args are not:
1076 HEAD, NEXT, BASE, PREV, etc
…
1079 <dt class=
"hdlist1">
1082 <dt class=
"hdlist1">
1087 it
’s not completely compatible with the --verbose
1088 output in svn log, but reasonably close.
1091 <dt class=
"hdlist1">
1096 is NOT the same as --max-count, doesn
’t count
1097 merged/excluded commits
1100 <dt class=
"hdlist1">
1109 <div class=
"paragraph"><p>New features:
</p></div>
1110 <div class=
"dlist"><dl>
1111 <dt class=
"hdlist1">
1116 shows the git commit sha1, as well
1119 <dt class=
"hdlist1">
1124 our version of --pretty=oneline
1128 <div class=
"admonitionblock">
1131 <div class=
"title">Note
</div>
1133 <td class=
"content">SVN itself only stores times in UTC and nothing else. The regular svn
1134 client converts the UTC time to the local time (or based on the TZ=
1135 environment). This command has the same behaviour.
</td>
1138 <div class=
"paragraph"><p>Any other arguments are passed directly to
<em>git log
</em></p></div>
1140 <dt class=
"hdlist1">
1145 Show what revision and author last modified each line of a file. The
1146 output of this mode is format-compatible with the output of
1147 ‘svn blame
’ by default. Like the SVN blame command,
1148 local uncommitted changes in the working tree are ignored;
1149 the version of the file in the HEAD revision is annotated. Unknown
1150 arguments are passed directly to
<em>git blame
</em>.
1152 <div class=
"dlist"><dl>
1153 <dt class=
"hdlist1">
1158 Produce output in the same format as
<em>git blame
</em>, but with
1159 SVN revision numbers instead of git commit hashes. In this mode,
1160 changes that haven
’t been committed to SVN (including local
1161 working-copy edits) are shown as revision
0.
1166 <dt class=
"hdlist1">
1171 When given an SVN revision number of the form
<em>rN
</em>, returns the
1172 corresponding git commit hash (this can optionally be followed by a
1173 tree-ish to specify which branch should be searched). When given a
1174 tree-ish, returns the corresponding SVN revision number.
1177 <dt class=
"hdlist1">
1182 You should consider using
<em>dcommit
</em> instead of this command.
1183 Commit specified commit or tree objects to SVN. This relies on
1184 your imported fetch data being up-to-date. This makes
1185 absolutely no attempts to do patching when committing to SVN, it
1186 simply overwrites files with those specified in the tree or
1187 commit. All merging is assumed to have taken place
1188 independently of
<em>git svn
</em> functions.
1191 <dt class=
"hdlist1">
1192 <em>create-ignore
</em>
1196 Recursively finds the svn:ignore property on directories and
1197 creates matching .gitignore files. The resulting files are staged to
1198 be committed, but are not committed. Use -r/--revision to refer to a
1202 <dt class=
"hdlist1">
1203 <em>show-ignore
</em>
1207 Recursively finds and lists the svn:ignore property on
1208 directories. The output is suitable for appending to
1209 the $GIT_DIR/info/exclude file.
1212 <dt class=
"hdlist1">
1217 Attempts to recreate empty directories that core git cannot track
1218 based on information in $GIT_DIR/svn/
<refname
>/unhandled.log files.
1219 Empty directories are automatically recreated when using
1220 "git svn clone" and
"git svn rebase", so
"mkdirs" is intended
1221 for use after commands like
"git checkout" or
"git reset".
1222 (See the svn-remote.
<name
>.automkdirs config file option for
1226 <dt class=
"hdlist1">
1227 <em>commit-diff
</em>
1231 Commits the diff of two tree-ish arguments from the
1232 command-line. This command does not rely on being inside an
<tt>git svn
1233 init
</tt>-ed repository. This command takes three arguments, (a) the
1234 original tree to diff against, (b) the new tree result, (c) the
1235 URL of the target Subversion repository. The final argument
1236 (URL) may be omitted if you are working from a
<em>git svn
</em>-aware
1237 repository (that has been
<tt>init
</tt>-ed with
<em>git svn
</em>).
1238 The -r
<revision
> option is required for this.
1241 <dt class=
"hdlist1">
1246 Shows information about a file or directory similar to what
1247 ‘svn info
’ provides. Does not currently support a -r/--revision
1248 argument. Use the --url option to output only the value of the
1249 <em>URL:
</em> field.
1252 <dt class=
"hdlist1">
1257 Lists the properties stored in the Subversion repository about a
1258 given file or directory. Use -r/--revision to refer to a specific
1259 Subversion revision.
1262 <dt class=
"hdlist1">
1267 Gets the Subversion property given as the first argument, for a
1268 file. A specific revision can be specified with -r/--revision.
1271 <dt class=
"hdlist1">
1272 <em>show-externals
</em>
1276 Shows the Subversion externals. Use -r/--revision to specify a
1280 <dt class=
"hdlist1">
1285 Compress $GIT_DIR/svn/
<refname
>/unhandled.log files in .git/svn
1286 and remove $GIT_DIR/svn/
<refname
>index files in .git/svn.
1289 <dt class=
"hdlist1">
1294 Undoes the effects of
<em>fetch
</em> back to the specified revision.
1295 This allows you to re-
<em>fetch
</em> an SVN revision. Normally the
1296 contents of an SVN revision should never change and
<em>reset
</em>
1297 should not be necessary. However, if SVN permissions change,
1298 or if you alter your --ignore-paths option, a
<em>fetch
</em> may fail
1299 with
"not found in commit" (file not previously visible) or
1300 "checksum mismatch" (missed a modification). If the problem
1301 file cannot be ignored forever (with --ignore-paths) the only
1302 way to repair the repo is to use
<em>reset
</em>.
1304 <div class=
"paragraph"><p>Only the rev_map and refs/remotes/git-svn are changed. Follow
<em>reset
</em>
1305 with a
<em>fetch
</em> and then
<em>git reset
</em> or
<em>git rebase
</em> to move local
1306 branches onto the new tree.
</p></div>
1307 <div class=
"dlist"><dl>
1308 <dt class=
"hdlist1">
1311 <dt class=
"hdlist1">
1312 --revision=
<n
>
1316 Specify the most recent revision to keep. All later revisions
1320 <dt class=
"hdlist1">
1323 <dt class=
"hdlist1">
1328 Discard the specified revision as well, keeping the nearest
1332 <dt class=
"hdlist1">
1337 Assume you have local changes in
"master", but you need to refetch
"r2".
1339 <div class=
"listingblock">
1340 <div class=
"content">
1341 <pre><tt> r1---r2---r3 remotes/git-svn
1343 A---B master
</tt></pre>
1345 <div class=
"paragraph"><p>Fix the ignore-paths or SVN permissions problem that caused
"r2" to
1346 be incomplete in the first place. Then:
</p></div>
1347 <div class=
"verseblock">
1348 <div class=
"verseblock-content">git svn reset -r2 -p
1350 <div class=
"verseblock-attribution">
1352 <div class=
"listingblock">
1353 <div class=
"content">
1354 <pre><tt> r1---r2'--r3' remotes/git-svn
1356 r2---r3---A---B master
</tt></pre>
1358 <div class=
"paragraph"><p>Then fixup
"master" with
<em>git rebase
</em>.
1359 Do NOT use
<em>git merge
</em> or your history will not be compatible with a
1360 future
<em>dcommit
</em>!
</p></div>
1361 <div class=
"verseblock">
1362 <div class=
"verseblock-content">git rebase --onto remotes/git-svn A^ master
</div>
1363 <div class=
"verseblock-attribution">
1365 <div class=
"listingblock">
1366 <div class=
"content">
1367 <pre><tt> r1---r2'--r3' remotes/git-svn
1369 A'--B' master
</tt></pre>
1376 <h2 id=
"_options">OPTIONS
</h2>
1377 <div class=
"sectionbody">
1378 <div class=
"dlist"><dl>
1379 <dt class=
"hdlist1">
1380 --shared[=(false|true|umask|group|all|world|everybody)]
1382 <dt class=
"hdlist1">
1383 --template=
<template_directory
>
1387 Only used with the
<em>init
</em> command.
1388 These are passed directly to
<em>git init
</em>.
1391 <dt class=
"hdlist1">
1394 <dt class=
"hdlist1">
1395 --revision
<arg
>
1399 Used with the
<em>fetch
</em> command.
1401 <div class=
"paragraph"><p>This allows revision ranges for partial/cauterized history
1402 to be supported. $NUMBER, $NUMBER1:$NUMBER2 (numeric ranges),
1403 $NUMBER:HEAD, and BASE:$NUMBER are all supported.
</p></div>
1404 <div class=
"paragraph"><p>This can allow you to make partial mirrors when running fetch;
1405 but is generally not recommended because history will be skipped
1408 <dt class=
"hdlist1">
1411 <dt class=
"hdlist1">
1416 Only used with the
<em>set-tree
</em> command.
1418 <div class=
"paragraph"><p>Read a list of commits from stdin and commit them in reverse
1419 order. Only the leading sha1 is read from each line, so
1420 <em>git rev-list --pretty=oneline
</em> output can be used.
</p></div>
1422 <dt class=
"hdlist1">
1427 Only used with the
<em>dcommit
</em>,
<em>set-tree
</em> and
<em>commit-diff
</em> commands.
1429 <div class=
"paragraph"><p>Remove directories from the SVN tree if there are no files left
1430 behind. SVN can version empty directories, and they are not
1431 removed by default if there are no files left in them. git
1432 cannot version empty directories. Enabling this flag will make
1433 the commit to SVN act like git.
</p></div>
1434 <div class=
"verseblock">
1435 <div class=
"verseblock-content">config key: svn.rmdir
</div>
1436 <div class=
"verseblock-attribution">
1439 <dt class=
"hdlist1">
1442 <dt class=
"hdlist1">
1447 Only used with the
<em>dcommit
</em>,
<em>set-tree
</em> and
<em>commit-diff
</em> commands.
1449 <div class=
"paragraph"><p>Edit the commit message before committing to SVN. This is off by
1450 default for objects that are commits, and forced on when committing
1451 tree objects.
</p></div>
1452 <div class=
"verseblock">
1453 <div class=
"verseblock-content">config key: svn.edit
</div>
1454 <div class=
"verseblock-attribution">
1457 <dt class=
"hdlist1">
1460 <dt class=
"hdlist1">
1461 --find-copies-harder
1465 Only used with the
<em>dcommit
</em>,
<em>set-tree
</em> and
<em>commit-diff
</em> commands.
1467 <div class=
"paragraph"><p>They are both passed directly to
<em>git diff-tree
</em>; see
1468 <a href=
"git-diff-tree.html">git-diff-tree(
1)
</a> for more information.
</p></div>
1469 <div class=
"verseblock">
1470 <div class=
"verseblock-content">config key: svn.l
1471 config key: svn.findcopiesharder
</div>
1472 <div class=
"verseblock-attribution">
1475 <dt class=
"hdlist1">
1478 <dt class=
"hdlist1">
1479 --authors-file=
<filename
>
1483 Syntax is compatible with the file used by
<em>git cvsimport
</em>:
1485 <div class=
"listingblock">
1486 <div class=
"content">
1487 <pre><tt> loginname = Joe User
<user@example.com
></tt></pre>
1489 <div class=
"paragraph"><p>If this option is specified and
<em>git svn
</em> encounters an SVN
1490 committer name that does not exist in the authors-file,
<em>git svn
</em>
1491 will abort operation. The user will then have to add the
1492 appropriate entry. Re-running the previous
<em>git svn
</em> command
1493 after the authors-file is modified should continue operation.
</p></div>
1494 <div class=
"verseblock">
1495 <div class=
"verseblock-content">config key: svn.authorsfile
</div>
1496 <div class=
"verseblock-attribution">
1499 <dt class=
"hdlist1">
1500 --authors-prog=
<filename
>
1504 If this option is specified, for each SVN committer name that
1505 does not exist in the authors file, the given file is executed
1506 with the committer name as the first argument. The program is
1507 expected to return a single line of the form
"Name <email>",
1508 which will be treated as if included in the authors file.
1511 <dt class=
"hdlist1">
1514 <dt class=
"hdlist1">
1519 Make
<em>git svn
</em> less verbose. Specify a second time to make it
1523 <dt class=
"hdlist1">
1524 --repack[=
<n
>]
1526 <dt class=
"hdlist1">
1527 --repack-flags=
<flags
>
1531 These should help keep disk usage sane for large fetches with
1534 <div class=
"paragraph"><p>--repack takes an optional argument for the number of revisions
1535 to fetch before repacking. This defaults to repacking every
1536 1000 commits fetched if no argument is specified.
</p></div>
1537 <div class=
"paragraph"><p>--repack-flags are passed directly to
<em>git repack
</em>.
</p></div>
1538 <div class=
"verseblock">
1539 <div class=
"verseblock-content">config key: svn.repack
1540 config key: svn.repackflags
</div>
1541 <div class=
"verseblock-attribution">
1544 <dt class=
"hdlist1">
1547 <dt class=
"hdlist1">
1550 <dt class=
"hdlist1">
1553 <dt class=
"hdlist1">
1554 --strategy=
<strategy
>
1558 These are only used with the
<em>dcommit
</em> and
<em>rebase
</em> commands.
1560 <div class=
"paragraph"><p>Passed directly to
<em>git rebase
</em> when using
<em>dcommit
</em> if a
1561 <em>git reset
</em> cannot be used (see
<em>dcommit
</em>).
</p></div>
1563 <dt class=
"hdlist1">
1566 <dt class=
"hdlist1">
1571 This can be used with the
<em>dcommit
</em>,
<em>rebase
</em>,
<em>branch
</em> and
1572 <em>tag
</em> commands.
1574 <div class=
"paragraph"><p>For
<em>dcommit
</em>, print out the series of git arguments that would show
1575 which diffs would be committed to SVN.
</p></div>
1576 <div class=
"paragraph"><p>For
<em>rebase
</em>, display the local branch associated with the upstream svn
1577 repository associated with the current branch and the URL of svn
1578 repository that will be fetched from.
</p></div>
1579 <div class=
"paragraph"><p>For
<em>branch
</em> and
<em>tag
</em>, display the urls that will be used for copying when
1580 creating the branch or tag.
</p></div>
1582 <dt class=
"hdlist1">
1587 When retrieving svn commits into git (as part of
<em>fetch
</em>,
<em>rebase
</em>, or
1588 <em>dcommit
</em> operations), look for the first
<tt>From:
</tt> or
<tt>Signed-off-by:
</tt> line
1589 in the log message and use that as the author string.
1592 <dt class=
"hdlist1">
1597 When committing to svn from git (as part of
<em>commit-diff
</em>,
<em>set-tree
</em> or
<em>dcommit
</em>
1598 operations), if the existing log message doesn
’t already have a
1599 <tt>From:
</tt> or
<tt>Signed-off-by:
</tt> line, append a
<tt>From:
</tt> line based on the
1600 git commit
’s author string. If you use this, then
<tt>--use-log-author
</tt>
1601 will retrieve a valid author string for all commits.
1606 <h2 id=
"_advanced_options">ADVANCED OPTIONS
</h2>
1607 <div class=
"sectionbody">
1608 <div class=
"dlist"><dl>
1609 <dt class=
"hdlist1">
1610 -i
<GIT_SVN_ID
>
1612 <dt class=
"hdlist1">
1613 --id
<GIT_SVN_ID
>
1617 This sets GIT_SVN_ID (instead of using the environment). This
1618 allows the user to override the default refname to fetch from
1619 when tracking a single URL. The
<em>log
</em> and
<em>dcommit
</em> commands
1620 no longer require this switch as an argument.
1623 <dt class=
"hdlist1">
1624 -R
<remote name
>
1626 <dt class=
"hdlist1">
1627 --svn-remote
<remote name
>
1631 Specify the [svn-remote
"<remote name>"] section to use,
1632 this allows SVN multiple repositories to be tracked.
1636 <dt class=
"hdlist1">
1641 This is especially helpful when we
’re tracking a directory
1642 that has been moved around within the repository, or if we
1643 started tracking a branch and never tracked the trunk it was
1644 descended from. This feature is enabled by default, use
1645 --no-follow-parent to disable it.
1647 <div class=
"verseblock">
1648 <div class=
"verseblock-content">config key: svn.followparent
</div>
1649 <div class=
"verseblock-attribution">
1654 <h2 id=
"_config_file_only_options">CONFIG FILE-ONLY OPTIONS
</h2>
1655 <div class=
"sectionbody">
1656 <div class=
"dlist"><dl>
1657 <dt class=
"hdlist1">
1660 <dt class=
"hdlist1">
1661 svn-remote.
<name
>.noMetadata
1665 This gets rid of the
<em>git-svn-id:
</em> lines at the end of every commit.
1667 <div class=
"paragraph"><p>This option can only be used for one-shot imports as
<em>git svn
</em>
1668 will not be able to fetch again without metadata. Additionally,
1669 if you lose your .git/svn/
<strong>*/.rev_map.
</strong> files,
<em>git svn
</em> will not
1670 be able to rebuild them.
</p></div>
1671 <div class=
"paragraph"><p>The
<em>git svn log
</em> command will not work on repositories using
1672 this, either. Using this conflicts with the
<em>useSvmProps
</em>
1673 option for (hopefully) obvious reasons.
</p></div>
1674 <div class=
"paragraph"><p>This option is NOT recommended as it makes it difficult to track down
1675 old references to SVN revision numbers in existing documentation, bug
1676 reports and archives. If you plan to eventually migrate from SVN to git
1677 and are certain about dropping SVN history, consider
1678 <a href=
"git-filter-branch.html">git-filter-branch(
1)
</a> instead. filter-branch also allows
1679 reformatting of metadata for ease-of-reading and rewriting authorship
1680 info for non-
"svn.authorsFile" users.
</p></div>
1682 <dt class=
"hdlist1">
1685 <dt class=
"hdlist1">
1686 svn-remote.
<name
>.useSvmProps
1690 This allows
<em>git svn
</em> to re-map repository URLs and UUIDs from
1691 mirrors created using SVN::Mirror (or svk) for metadata.
1693 <div class=
"paragraph"><p>If an SVN revision has a property,
"svm:headrev", it is likely
1694 that the revision was created by SVN::Mirror (also used by SVK).
1695 The property contains a repository UUID and a revision. We want
1696 to make it look like we are mirroring the original URL, so
1697 introduce a helper function that returns the original identity
1698 URL and UUID, and use it when generating metadata in commit
1701 <dt class=
"hdlist1">
1704 <dt class=
"hdlist1">
1705 svn-remote.
<name
>.useSvnsyncprops
1709 Similar to the useSvmProps option; this is for users
1710 of the svnsync(
1) command distributed with SVN
1.4.x and
1714 <dt class=
"hdlist1">
1715 svn-remote.
<name
>.rewriteRoot
1719 This allows users to create repositories from alternate
1720 URLs. For example, an administrator could run
<em>git svn
</em> on the
1721 server locally (accessing via file://) but wish to distribute
1722 the repository with a public http:// or svn:// URL in the
1723 metadata so users of it will see the public URL.
1726 <dt class=
"hdlist1">
1727 svn-remote.
<name
>.rewriteUUID
1731 Similar to the useSvmProps option; this is for users who need
1732 to remap the UUID manually. This may be useful in situations
1733 where the original UUID is not available via either useSvmProps
1737 <dt class=
"hdlist1">
1738 svn-remote.
<name
>.pushurl
1742 Similar to git
’s
<em>remote.
<name
>.pushurl
</em>, this key is designed
1743 to be used in cases where
<em>url
</em> points to an SVN repository
1744 via a read-only transport, to provide an alternate read/write
1745 transport. It is assumed that both keys point to the same
1746 repository. Unlike
<em>commiturl
</em>,
<em>pushurl
</em> is a base path. If
1747 either
<em>commiturl
</em> or
<em>pushurl
</em> could be used,
<em>commiturl
</em>
1751 <dt class=
"hdlist1">
1752 svn.brokenSymlinkWorkaround
1756 This disables potentially expensive checks to workaround
1757 broken symlinks checked into SVN by broken clients. Set this
1758 option to
"false" if you track a SVN repository with many
1759 empty blobs that are not symlinks. This option may be changed
1760 while
<em>git svn
</em> is running and take effect on the next
1761 revision fetched. If unset,
<em>git svn
</em> assumes this option to
1765 <dt class=
"hdlist1">
1766 svn.pathnameencoding
1770 This instructs git svn to recode pathnames to a given encoding.
1771 It can be used by windows users and by those who work in non-utf8
1772 locales to avoid corrupted file names with non-ASCII characters.
1773 Valid encodings are the ones supported by Perl
’s Encode module.
1776 <dt class=
"hdlist1">
1777 svn-remote.
<name
>.automkdirs
1781 Normally, the
"git svn clone" and
"git svn rebase" commands
1782 attempt to recreate empty directories that are in the
1783 Subversion repository. If this option is set to
"false", then
1784 empty directories will only be created if the
"git svn mkdirs"
1785 command is run explicitly. If unset,
<em>git svn
</em> assumes this
1786 option to be
"true".
1790 <div class=
"paragraph"><p>Since the noMetadata, rewriteRoot, rewriteUUID, useSvnsyncProps and useSvmProps
1791 options all affect the metadata generated and used by
<em>git svn
</em>; they
1792 <strong>must
</strong> be set in the configuration file before any history is imported
1793 and these settings should never be changed once they are set.
</p></div>
1794 <div class=
"paragraph"><p>Additionally, only one of these options can be used per svn-remote
1795 section because they affect the
<em>git-svn-id:
</em> metadata line, except
1796 for rewriteRoot and rewriteUUID which can be used together.
</p></div>
1798 <h2 id=
"_basic_examples">BASIC EXAMPLES
</h2>
1799 <div class=
"sectionbody">
1800 <div class=
"paragraph"><p>Tracking and contributing to the trunk of a Subversion-managed project:
</p></div>
1801 <div class=
"listingblock">
1802 <div class=
"content">
1803 <pre><tt># Clone a repo (like git clone):
1804 git svn clone http://svn.example.com/project/trunk
1805 # Enter the newly cloned directory:
1807 # You should be on master branch, double-check with 'git branch'
1809 # Do some work and commit locally to git:
1811 # Something is committed to SVN, rebase your local changes against the
1812 # latest changes in SVN:
1814 # Now commit your changes (that were committed previously using git) to SVN,
1815 # as well as automatically updating your working HEAD:
1817 # Append svn:ignore settings to the default git exclude file:
1818 git svn show-ignore
>> .git/info/exclude
</tt></pre>
1820 <div class=
"paragraph"><p>Tracking and contributing to an entire Subversion-managed project
1821 (complete with a trunk, tags and branches):
</p></div>
1822 <div class=
"listingblock">
1823 <div class=
"content">
1824 <pre><tt># Clone a repo (like git clone):
1825 git svn clone http://svn.example.com/project -T trunk -b branches -t tags
1826 # View all branches and tags you have cloned:
1828 # Create a new branch in SVN
1829 git svn branch waldo
1830 # Reset your master to trunk (or any other branch, replacing 'trunk'
1831 # with the appropriate name):
1832 git reset --hard remotes/trunk
1833 # You may only dcommit to one branch/tag/trunk at a time. The usage
1834 # of dcommit/rebase/show-ignore should be the same as above.
</tt></pre>
1836 <div class=
"paragraph"><p>The initial
<em>git svn clone
</em> can be quite time-consuming
1837 (especially for large Subversion repositories). If multiple
1838 people (or one person with multiple machines) want to use
1839 <em>git svn
</em> to interact with the same Subversion repository, you can
1840 do the initial
<em>git svn clone
</em> to a repository on a server and
1841 have each person clone that repository with
<em>git clone
</em>:
</p></div>
1842 <div class=
"listingblock">
1843 <div class=
"content">
1844 <pre><tt># Do the initial import on a server
1845 ssh server
"cd /pub && git svn clone http://svn.example.com/project
1846 # Clone locally - make sure the refs/remotes/ space matches the server
1850 git remote add origin server:/pub/project
1851 git config --replace-all remote.origin.fetch '+refs/remotes/*:refs/remotes/*'
1853 # Prevent fetch/pull from remote git server in the future,
1854 # we only want to use git svn for future updates
1855 git config --remove-section remote.origin
1856 # Create a local branch from one of the branches just fetched
1857 git checkout -b master FETCH_HEAD
1858 # Initialize 'git svn' locally (be sure to use the same URL and -T/-b/-t options as were used on server)
1859 git svn init http://svn.example.com/project
1860 # Pull the latest changes from Subversion
1861 git svn rebase</tt></pre>
1864 <h2 id="_rebase_vs_pull_merge
">REBASE VS. PULL/MERGE</h2>
1865 <div class="sectionbody
">
1866 <div class="paragraph
"><p>Originally, <em>git svn</em> recommended that the <em>remotes/git-svn</em> branch be
1867 pulled or merged from. This is because the author favored
1868 <tt>git svn set-tree B</tt> to commit a single head rather than the
1869 <tt>git svn set-tree A..B</tt> notation to commit multiple commits.</p></div>
1870 <div class="paragraph
"><p>If you use <tt>git svn set-tree A..B</tt> to commit several diffs and you do
1871 not have the latest remotes/git-svn merged into my-branch, you should
1872 use <tt>git svn rebase</tt> to update your work branch instead of <tt>git pull</tt> or
1873 <tt>git merge</tt>. <tt>pull</tt>/<tt>merge</tt> can cause non-linear history to be flattened
1874 when committing into SVN, which can lead to merge commits reversing
1875 previous commits in SVN.</p></div>
1877 <h2 id="_merge_tracking
">MERGE TRACKING</h2>
1878 <div class="sectionbody
">
1879 <div class="paragraph
"><p>While <em>git svn</em> can track
1880 copy history (including branches and tags) for repositories adopting a
1881 standard layout, it cannot yet represent merge history that happened
1882 inside git back upstream to SVN users. Therefore it is advised that
1883 users keep history as linear as possible inside git to ease
1884 compatibility with SVN (see the CAVEATS section below).</p></div>
1886 <h2 id="_caveats
">CAVEATS</h2>
1887 <div class="sectionbody
">
1888 <div class="paragraph
"><p>For the sake of simplicity and interoperating with Subversion,
1889 it is recommended that all <em>git svn</em> users clone, fetch and dcommit
1890 directly from the SVN server, and avoid all <em>git clone</em>/<em>pull</em>/<em>merge</em>/<em>push</em>
1891 operations between git repositories and branches. The recommended
1892 method of exchanging code between git branches and users is
1893 <em>git format-patch</em> and <em>git am</em>, or just 'dcommit’ing to the SVN repository.</p></div>
1894 <div class="paragraph
"><p>Running <em>git merge</em> or <em>git pull</em> is NOT recommended on a branch you
1895 plan to <em>dcommit</em> from because Subversion users cannot see any
1896 merges you’ve made. Furthermore, if you merge or pull from a git branch
1897 that is a mirror of an SVN branch, <em>dcommit</em> may commit to the wrong
1899 <div class="paragraph
"><p>If you do merge, note the following rule: <em>git svn dcommit</em> will
1900 attempt to commit on top of the SVN commit named in</p></div>
1901 <div class="listingblock
">
1902 <div class="content
">
1903 <pre><tt>git log --grep=^git-svn-id: --first-parent -1</tt></pre>
1905 <div class="paragraph
"><p>You <em>must</em> therefore ensure that the most recent commit of the branch
1906 you want to dcommit to is the <em>first</em> parent of the merge. Chaos will
1907 ensue otherwise, especially if the first parent is an older commit on
1908 the same SVN branch.</p></div>
1909 <div class="paragraph
"><p><em>git clone</em> does not clone branches under the refs/remotes/ hierarchy or
1910 any <em>git svn</em> metadata, or config. So repositories created and managed with
1911 using <em>git svn</em> should use <em>rsync</em> for cloning, if cloning is to be done
1913 <div class="paragraph
"><p>Since <em>dcommit</em> uses rebase internally, any git branches you <em>git push</em> to
1914 before <em>dcommit</em> on will require forcing an overwrite of the existing ref
1915 on the remote repository. This is generally considered bad practice,
1916 see the <a href="git-push.html
">git-push(1)</a> documentation for details.</p></div>
1917 <div class="paragraph
"><p>Do not use the --amend option of <a href="git-commit.html
">git-commit(1)</a> on a change you’ve
1918 already dcommitted. It is considered bad practice to --amend commits
1919 you’ve already pushed to a remote repository for other users, and
1920 dcommit with SVN is analogous to that.</p></div>
1921 <div class="paragraph
"><p>When using multiple --branches or --tags, <em>git svn</em> does not automatically
1922 handle name collisions (for example, if two branches from different paths have
1923 the same name, or if a branch and a tag have the same name). In these cases,
1924 use <em>init</em> to set up your git repository then, before your first <em>fetch</em>, edit
1925 the .git/config file so that the branches and tags are associated with
1926 different name spaces. For example:</p></div>
1927 <div class="literalblock
">
1928 <div class="content
">
1929 <pre><tt>branches = stable/*:refs/remotes/svn/stable/*
1930 branches = debug/*:refs/remotes/svn/debug/*</tt></pre>
1933 <h2 id="_bugs
">BUGS</h2>
1934 <div class="sectionbody
">
1935 <div class="paragraph
"><p>We ignore all SVN properties except svn:executable. Any unhandled
1936 properties are logged to $GIT_DIR/svn/<refname>/unhandled.log</p></div>
1937 <div class="paragraph
"><p>Renamed and copied directories are not detected by git and hence not
1938 tracked when committing to SVN. I do not plan on adding support for
1939 this as it’s quite difficult and time-consuming to get working for all
1940 the possible corner cases (git doesn’t do it, either). Committing
1941 renamed and copied files is fully supported if they’re similar enough
1942 for git to detect them.</p></div>
1944 <h2 id="_configuration
">CONFIGURATION</h2>
1945 <div class="sectionbody
">
1946 <div class="paragraph
"><p><em>git svn</em> stores [svn-remote] configuration information in the
1947 repository .git/config file. It is similar the core git
1948 [remote] sections except <em>fetch</em> keys do not accept glob
1949 arguments; but they are instead handled by the <em>branches</em>
1950 and <em>tags</em> keys. Since some SVN repositories are oddly
1951 configured with multiple projects glob expansions such those
1952 listed below are allowed:</p></div>
1953 <div class="listingblock
">
1954 <div class="content
">
1955 <pre><tt>[svn-remote "project-a
"]
1956 url = http://server.org/svn
1957 fetch = trunk/project-a:refs/remotes/project-a/trunk
1958 branches = branches/*/project-a:refs/remotes/project-a/branches/*
1959 tags = tags/*/project-a:refs/remotes/project-a/tags/*</tt></pre>
1961 <div class="paragraph
"><p>Keep in mind that the <em>*</em> (asterisk) wildcard of the local ref
1962 (right of the <em>:</em>) <strong>must</strong> be the farthest right path component;
1963 however the remote wildcard may be anywhere as long as it’s an
1964 independent path component (surrounded by <em>/</em> or EOL). This
1965 type of configuration is not automatically created by <em>init</em> and
1966 should be manually entered with a text-editor or using <em>git config</em>.</p></div>
1967 <div class="paragraph
"><p>It is also possible to fetch a subset of branches or tags by using a
1968 comma-separated list of names within braces. For example:</p></div>
1969 <div class="listingblock
">
1970 <div class="content
">
1971 <pre><tt>[svn-remote "huge-project
"]
1972 url = http://server.org/svn
1973 fetch = trunk/src:refs/remotes/trunk
1974 branches = branches/{red,green}/src:refs/remotes/branches/*
1975 tags = tags/{1.0,2.0}/src:refs/remotes/tags/*</tt></pre>
1977 <div class="paragraph
"><p>Note that git-svn keeps track of the highest revision in which a branch
1978 or tag has appeared. If the subset of branches or tags is changed after
1979 fetching, then .git/svn/.metadata must be manually edited to remove (or
1980 reset) branches-maxRev and/or tags-maxRev as appropriate.</p></div>
1982 <h2 id="_see_also
">SEE ALSO</h2>
1983 <div class="sectionbody
">
1984 <div class="paragraph
"><p><a href="git-rebase.html
">git-rebase(1)</a></p></div>
1986 <h2 id="_git
">GIT</h2>
1987 <div class="sectionbody
">
1988 <div class="paragraph
"><p>Part of the <a href="git.html
">git(1)</a> suite</p></div>
1991 <div id="footnotes
"><hr /></div>
1993 <div id="footer-text
">
1994 Last updated 2011-10-05 13:59:16 PDT