git-svn.html   [plain text]


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 8.5.2" />
<title>git-svn(1)</title>
<style type="text/css">
/* Debug borders */
p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
/*
  border: 1px solid red;
*/
}

body {
  margin: 1em 5% 1em 5%;
}

a {
  color: blue;
  text-decoration: underline;
}
a:visited {
  color: fuchsia;
}

em {
  font-style: italic;
  color: navy;
}

strong {
  font-weight: bold;
  color: #083194;
}

tt {
  color: navy;
}

h1, h2, h3, h4, h5, h6 {
  color: #527bbd;
  font-family: sans-serif;
  margin-top: 1.2em;
  margin-bottom: 0.5em;
  line-height: 1.3;
}

h1, h2, h3 {
  border-bottom: 2px solid silver;
}
h2 {
  padding-top: 0.5em;
}
h3 {
  float: left;
}
h3 + * {
  clear: left;
}

div.sectionbody {
  font-family: serif;
  margin-left: 0;
}

hr {
  border: 1px solid silver;
}

p {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

ul, ol, li > p {
  margin-top: 0;
}

pre {
  padding: 0;
  margin: 0;
}

span#author {
  color: #527bbd;
  font-family: sans-serif;
  font-weight: bold;
  font-size: 1.1em;
}
span#email {
}
span#revnumber, span#revdate, span#revremark {
  font-family: sans-serif;
}

div#footer {
  font-family: sans-serif;
  font-size: small;
  border-top: 2px solid silver;
  padding-top: 0.5em;
  margin-top: 4.0em;
}
div#footer-text {
  float: left;
  padding-bottom: 0.5em;
}
div#footer-badges {
  float: right;
  padding-bottom: 0.5em;
}

div#preamble {
  margin-top: 1.5em;
  margin-bottom: 1.5em;
}
div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
div.admonitionblock {
  margin-top: 1.0em;
  margin-bottom: 1.5em;
}
div.admonitionblock {
  margin-top: 2.0em;
  margin-bottom: 2.0em;
  margin-right: 10%;
  color: #606060;
}

div.content { /* Block element content. */
  padding: 0;
}

/* Block element titles. */
div.title, caption.title {
  color: #527bbd;
  font-family: sans-serif;
  font-weight: bold;
  text-align: left;
  margin-top: 1.0em;
  margin-bottom: 0.5em;
}
div.title + * {
  margin-top: 0;
}

td div.title:first-child {
  margin-top: 0.0em;
}
div.content div.title:first-child {
  margin-top: 0.0em;
}
div.content + div.title {
  margin-top: 0.0em;
}

div.sidebarblock > div.content {
  background: #ffffee;
  border: 1px solid silver;
  padding: 0.5em;
}

div.listingblock > div.content {
  border: 1px solid silver;
  background: #f4f4f4;
  padding: 0.5em;
}

div.quoteblock, div.verseblock {
  padding-left: 1.0em;
  margin-left: 1.0em;
  margin-right: 10%;
  border-left: 5px solid #dddddd;
  color: #777777;
}

div.quoteblock > div.attribution {
  padding-top: 0.5em;
  text-align: right;
}

div.verseblock > div.content {
  white-space: pre;
}
div.verseblock > div.attribution {
  padding-top: 0.75em;
  text-align: left;
}
/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
div.verseblock + div.attribution {
  text-align: left;
}

div.admonitionblock .icon {
  vertical-align: top;
  font-size: 1.1em;
  font-weight: bold;
  text-decoration: underline;
  color: #527bbd;
  padding-right: 0.5em;
}
div.admonitionblock td.content {
  padding-left: 0.5em;
  border-left: 3px solid #dddddd;
}

div.exampleblock > div.content {
  border-left: 3px solid #dddddd;
  padding-left: 0.5em;
}

div.imageblock div.content { padding-left: 0; }
span.image img { border-style: none; }
a.image:visited { color: white; }

dl {
  margin-top: 0.8em;
  margin-bottom: 0.8em;
}
dt {
  margin-top: 0.5em;
  margin-bottom: 0;
  font-style: normal;
  color: navy;
}
dd > *:first-child {
  margin-top: 0.1em;
}

ul, ol {
    list-style-position: outside;
}
ol.arabic {
  list-style-type: decimal;
}
ol.loweralpha {
  list-style-type: lower-alpha;
}
ol.upperalpha {
  list-style-type: upper-alpha;
}
ol.lowerroman {
  list-style-type: lower-roman;
}
ol.upperroman {
  list-style-type: upper-roman;
}

div.compact ul, div.compact ol,
div.compact p, div.compact p,
div.compact div, div.compact div {
  margin-top: 0.1em;
  margin-bottom: 0.1em;
}

div.tableblock > table {
  border: 3px solid #527bbd;
}
thead, p.table.header {
  font-family: sans-serif;
  font-weight: bold;
}
tfoot {
  font-weight: bold;
}
td > div.verse {
  white-space: pre;
}
p.table {
  margin-top: 0;
}
/* Because the table frame attribute is overriden by CSS in most browsers. */
div.tableblock > table[frame="void"] {
  border-style: none;
}
div.tableblock > table[frame="hsides"] {
  border-left-style: none;
  border-right-style: none;
}
div.tableblock > table[frame="vsides"] {
  border-top-style: none;
  border-bottom-style: none;
}


div.hdlist {
  margin-top: 0.8em;
  margin-bottom: 0.8em;
}
div.hdlist tr {
  padding-bottom: 15px;
}
dt.hdlist1.strong, td.hdlist1.strong {
  font-weight: bold;
}
td.hdlist1 {
  vertical-align: top;
  font-style: normal;
  padding-right: 0.8em;
  color: navy;
}
td.hdlist2 {
  vertical-align: top;
}
div.hdlist.compact tr {
  margin: 0;
  padding-bottom: 0;
}

.comment {
  background: yellow;
}

.footnote, .footnoteref {
  font-size: 0.8em;
}

span.footnote, span.footnoteref {
  vertical-align: super;
}

#footnotes {
  margin: 20px 0 20px 0;
  padding: 7px 0 0 0;
}

#footnotes div.footnote {
  margin: 0 0 5px 0;
}

#footnotes hr {
  border: none;
  border-top: 1px solid silver;
  height: 1px;
  text-align: left;
  margin-left: 0;
  width: 20%;
  min-width: 100px;
}


@media print {
  div#footer-badges { display: none; }
}

div#toc {
  margin-bottom: 2.5em;
}

div#toctitle {
  color: #527bbd;
  font-family: sans-serif;
  font-size: 1.1em;
  font-weight: bold;
  margin-top: 1.0em;
  margin-bottom: 0.1em;
}

div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
  margin-top: 0;
  margin-bottom: 0;
}
div.toclevel2 {
  margin-left: 2em;
  font-size: 0.9em;
}
div.toclevel3 {
  margin-left: 4em;
  font-size: 0.9em;
}
div.toclevel4 {
  margin-left: 6em;
  font-size: 0.9em;
}
/* Overrides for manpage documents */
h1 {
  padding-top: 0.5em;
  padding-bottom: 0.5em;
  border-top: 2px solid silver;
  border-bottom: 2px solid silver;
}
h2 {
  border-style: none;
}
div.sectionbody {
  margin-left: 5%;
}

@media print {
  div#toc { display: none; }
}

/* Workarounds for IE6's broken and incomplete CSS2. */

div.sidebar-content {
  background: #ffffee;
  border: 1px solid silver;
  padding: 0.5em;
}
div.sidebar-title, div.image-title {
  color: #527bbd;
  font-family: sans-serif;
  font-weight: bold;
  margin-top: 0.0em;
  margin-bottom: 0.5em;
}

div.listingblock div.content {
  border: 1px solid silver;
  background: #f4f4f4;
  padding: 0.5em;
}

div.quoteblock-attribution {
  padding-top: 0.5em;
  text-align: right;
}

div.verseblock-content {
  white-space: pre;
}
div.verseblock-attribution {
  padding-top: 0.75em;
  text-align: left;
}

div.exampleblock-content {
  border-left: 3px solid #dddddd;
  padding-left: 0.5em;
}

/* IE6 sets dynamically generated links as visited. */
div#toc a:visited { color: blue; }
</style>
<script type="text/javascript">
/*<![CDATA[*/
window.onload = function(){asciidoc.footnotes();}
var asciidoc = {  // Namespace.

/////////////////////////////////////////////////////////////////////
// Table Of Contents generator
/////////////////////////////////////////////////////////////////////

/* Author: Mihai Bazon, September 2002
 * http://students.infoiasi.ro/~mishoo
 *
 * Table Of Content generator
 * Version: 0.4
 *
 * Feel free to use this script under the terms of the GNU General Public
 * License, as long as you do not remove or alter this notice.
 */

 /* modified by Troy D. Hanson, September 2006. License: GPL */
 /* modified by Stuart Rackham, 2006, 2009. License: GPL */

// toclevels = 1..4.
toc: function (toclevels) {

  function getText(el) {
    var text = "";
    for (var i = el.firstChild; i != null; i = i.nextSibling) {
      if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
        text += i.data;
      else if (i.firstChild != null)
        text += getText(i);
    }
    return text;
  }

  function TocEntry(el, text, toclevel) {
    this.element = el;
    this.text = text;
    this.toclevel = toclevel;
  }

  function tocEntries(el, toclevels) {
    var result = new Array;
    var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
    // Function that scans the DOM tree for header elements (the DOM2
    // nodeIterator API would be a better technique but not supported by all
    // browsers).
    var iterate = function (el) {
      for (var i = el.firstChild; i != null; i = i.nextSibling) {
        if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
          var mo = re.exec(i.tagName);
          if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
            result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
          }
          iterate(i);
        }
      }
    }
    iterate(el);
    return result;
  }

  var toc = document.getElementById("toc");
  var entries = tocEntries(document.getElementById("content"), toclevels);
  for (var i = 0; i < entries.length; ++i) {
    var entry = entries[i];
    if (entry.element.id == "")
      entry.element.id = "_toc_" + i;
    var a = document.createElement("a");
    a.href = "#" + entry.element.id;
    a.appendChild(document.createTextNode(entry.text));
    var div = document.createElement("div");
    div.appendChild(a);
    div.className = "toclevel" + entry.toclevel;
    toc.appendChild(div);
  }
  if (entries.length == 0)
    toc.parentNode.removeChild(toc);
},


/////////////////////////////////////////////////////////////////////
// Footnotes generator
/////////////////////////////////////////////////////////////////////

/* Based on footnote generation code from:
 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
 */

footnotes: function () {
  var cont = document.getElementById("content");
  var noteholder = document.getElementById("footnotes");
  var spans = cont.getElementsByTagName("span");
  var refs = {};
  var n = 0;
  for (i=0; i<spans.length; i++) {
    if (spans[i].className == "footnote") {
      n++;
      // Use [\s\S] in place of . so multi-line matches work.
      // Because JavaScript has no s (dotall) regex flag.
      note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
      noteholder.innerHTML +=
        "<div class='footnote' id='_footnote_" + n + "'>" +
        "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
        n + "</a>. " + note + "</div>";
      spans[i].innerHTML =
        "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
        "' title='View footnote' class='footnote'>" + n + "</a>]";
      var id =spans[i].getAttribute("id");
      if (id != null) refs["#"+id] = n;
    }
  }
  if (n == 0)
    noteholder.parentNode.removeChild(noteholder);
  else {
    // Process footnoterefs.
    for (i=0; i<spans.length; i++) {
      if (spans[i].className == "footnoteref") {
        var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
        href = href.match(/#.*/)[0];  // Because IE return full URL.
        n = refs[href];
        spans[i].innerHTML =
          "[<a href='#_footnote_" + n +
          "' title='View footnote' class='footnote'>" + n + "</a>]";
      }
    }
  }
}

}
/*]]>*/
</script>
</head>
<body>
<div id="header">
<h1>
git-svn(1) Manual Page
</h1>
<h2>NAME</h2>
<div class="sectionbody">
<p>git-svn -
   Bidirectional operation between a Subversion repository and git
</p>
</div>
</div>
<div id="content">
<h2 id="_synopsis">SYNOPSIS</h2>
<div class="sectionbody">
<div class="verseblock">
<div class="verseblock-content"><em>git svn</em> &lt;command&gt; [options] [arguments]</div>
<div class="verseblock-attribution">
</div></div>
</div>
<h2 id="_description">DESCRIPTION</h2>
<div class="sectionbody">
<div class="paragraph"><p><em>git svn</em> is a simple conduit for changesets between Subversion and git.
It provides a bidirectional flow of changes between a Subversion and a git
repository.</p></div>
<div class="paragraph"><p><em>git svn</em> can track a standard Subversion repository,
following the common "trunk/branches/tags" layout, with the --stdlayout option.
It can also follow branches and tags in any layout with the -T/-t/-b options
(see options to <em>init</em> below, and also the <em>clone</em> command).</p></div>
<div class="paragraph"><p>Once tracking a Subversion repository (with any of the above methods), the git
repository can be updated from Subversion by the <em>fetch</em> command and
Subversion updated from git by the <em>dcommit</em> command.</p></div>
</div>
<h2 id="_commands">COMMANDS</h2>
<div class="sectionbody">
<div class="dlist"><dl>
<dt class="hdlist1">
<em>init</em>
</dt>
<dd>
<p>
        Initializes an empty git repository with additional
        metadata directories for <em>git svn</em>.  The Subversion URL
        may be specified as a command-line argument, or as full
        URL arguments to -T/-t/-b.  Optionally, the target
        directory to operate on can be specified as a second
        argument.  Normally this command initializes the current
        directory.
</p>
<div class="dlist"><dl>
<dt class="hdlist1">
-T&lt;trunk_subdir&gt;
</dt>
<dt class="hdlist1">
--trunk=&lt;trunk_subdir&gt;
</dt>
<dt class="hdlist1">
-t&lt;tags_subdir&gt;
</dt>
<dt class="hdlist1">
--tags=&lt;tags_subdir&gt;
</dt>
<dt class="hdlist1">
-b&lt;branches_subdir&gt;
</dt>
<dt class="hdlist1">
--branches=&lt;branches_subdir&gt;
</dt>
<dt class="hdlist1">
-s
</dt>
<dt class="hdlist1">
--stdlayout
</dt>
<dd>
<p>
        These are optional command-line options for init.  Each of
        these flags can point to a relative repository path
        (--tags=project/tags) or a full url
        (--tags=https://foo.org/project/tags).
        You can specify more than one --tags and/or --branches options, in case
        your Subversion repository places tags or branches under multiple paths.
        The option --stdlayout is
        a shorthand way of setting trunk,tags,branches as the relative paths,
        which is the Subversion default. If any of the other options are given
        as well, they take precedence.
</p>
</dd>
<dt class="hdlist1">
--no-metadata
</dt>
<dd>
<p>
        Set the <em>noMetadata</em> option in the [svn-remote] config.
        This option is not recommended, please read the <em>svn.noMetadata</em>
        section of this manpage before using this option.
</p>
</dd>
<dt class="hdlist1">
--use-svm-props
</dt>
<dd>
<p>
        Set the <em>useSvmProps</em> option in the [svn-remote] config.
</p>
</dd>
<dt class="hdlist1">
--use-svnsync-props
</dt>
<dd>
<p>
        Set the <em>useSvnsyncProps</em> option in the [svn-remote] config.
</p>
</dd>
<dt class="hdlist1">
--rewrite-root=&lt;URL&gt;
</dt>
<dd>
<p>
        Set the <em>rewriteRoot</em> option in the [svn-remote] config.
</p>
</dd>
<dt class="hdlist1">
--rewrite-uuid=&lt;UUID&gt;
</dt>
<dd>
<p>
        Set the <em>rewriteUUID</em> option in the [svn-remote] config.
</p>
</dd>
<dt class="hdlist1">
--username=&lt;user&gt;
</dt>
<dd>
<p>
        For transports that SVN handles authentication for (http,
        https, and plain svn), specify the username.  For other
        transports (eg svn+ssh://), you must include the username in
        the URL, eg svn+ssh://foo@svn.bar.com/project
</p>
</dd>
<dt class="hdlist1">
--prefix=&lt;prefix&gt;
</dt>
<dd>
<p>
        This allows one to specify a prefix which is prepended
        to the names of remotes if trunk/branches/tags are
        specified.  The prefix does not automatically include a
        trailing slash, so be sure you include one in the
        argument if that is what you want.  If --branches/-b is
        specified, the prefix must include a trailing slash.
        Setting a prefix is useful if you wish to track multiple
        projects that share a common repository.
</p>
</dd>
<dt class="hdlist1">
--ignore-paths=&lt;regex&gt;
</dt>
<dd>
<p>
        When passed to <em>init</em> or <em>clone</em> this regular expression will
        be preserved as a config key.  See <em>fetch</em> for a description
        of <em>--ignore-paths</em>.
</p>
</dd>
<dt class="hdlist1">
--no-minimize-url
</dt>
<dd>
<p>
        When tracking multiple directories (using --stdlayout,
        --branches, or --tags options), git svn will attempt to connect
        to the root (or highest allowed level) of the Subversion
        repository.  This default allows better tracking of history if
        entire projects are moved within a repository, but may cause
        issues on repositories where read access restrictions are in
        place.  Passing <em>--no-minimize-url</em> will allow git svn to
        accept URLs as-is without attempting to connect to a higher
        level directory.  This option is off by default when only
        one URL/branch is tracked (it would do little good).
</p>
</dd>
</dl></div>
</dd>
<dt class="hdlist1">
<em>fetch</em>
</dt>
<dd>
<p>
        Fetch unfetched revisions from the Subversion remote we are
        tracking.  The name of the [svn-remote "&#8230;"] section in the
        .git/config file may be specified as an optional command-line
        argument.
</p>
<div class="dlist"><dl>
<dt class="hdlist1">
--localtime
</dt>
<dd>
<p>
        Store Git commit times in the local timezone instead of UTC.  This
        makes <em>git log</em> (even without --date=local) show the same times
        that <tt>svn log</tt> would in the local timezone.
</p>
<div class="paragraph"><p>This doesn&#8217;t interfere with interoperating with the Subversion
repository you cloned from, but if you wish for your local Git
repository to be able to interoperate with someone else&#8217;s local Git
repository, either don&#8217;t use this option or you should both use it in
the same local timezone.</p></div>
</dd>
<dt class="hdlist1">
--parent
</dt>
<dd>
<p>
        Fetch only from the SVN parent of the current HEAD.
</p>
</dd>
<dt class="hdlist1">
--ignore-paths=&lt;regex&gt;
</dt>
<dd>
<p>
        This allows one to specify a Perl regular expression that will
        cause skipping of all matching paths from checkout from SVN.
        The <em>--ignore-paths</em> option should match for every <em>fetch</em>
        (including automatic fetches due to <em>clone</em>, <em>dcommit</em>,
        <em>rebase</em>, etc) on a given repository.
</p>
<div class="verseblock">
<div class="verseblock-content">config key: svn-remote.&lt;name&gt;.ignore-paths</div>
<div class="verseblock-attribution">
</div></div>
<div class="paragraph"><p>If the ignore-paths config key is set and the command line option is
also given, both regular expressions will be used.</p></div>
<div class="paragraph"><p>Examples:</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
Skip "doc*" directory for every fetch
</dt>
<dd>
<div class="listingblock">
<div class="content">
<pre><tt>--ignore-paths="^doc"</tt></pre>
</div></div>
</dd>
<dt class="hdlist1">
Skip "branches" and "tags" of first level directories
</dt>
<dd>
<div class="listingblock">
<div class="content">
<pre><tt>--ignore-paths="^[^/]+/(?:branches|tags)"</tt></pre>
</div></div>
</dd>
</dl></div>
</dd>
</dl></div>
</dd>
<dt class="hdlist1">
<em>clone</em>
</dt>
<dd>
<p>
        Runs <em>init</em> and <em>fetch</em>.  It will automatically create a
        directory based on the basename of the URL passed to it;
        or if a second argument is passed; it will create a directory
        and work within that.  It accepts all arguments that the
        <em>init</em> and <em>fetch</em> commands accept; with the exception of
        <em>--fetch-all</em> and <em>--parent</em>.  After a repository is cloned,
        the <em>fetch</em> command will be able to update revisions without
        affecting the working tree; and the <em>rebase</em> command will be
        able to update the working tree with the latest changes.
</p>
<div class="dlist"><dl>
<dt class="hdlist1">
--preserve-empty-dirs
</dt>
<dd>
<p>
        Create a placeholder file in the local Git repository for each
        empty directory fetched from Subversion.  This includes directories
        that become empty by removing all entries in the Subversion
        repository (but not the directory itself).  The placeholder files
        are also tracked and removed when no longer necessary.
</p>
</dd>
<dt class="hdlist1">
--placeholder-filename=&lt;filename&gt;
</dt>
<dd>
<p>
        Set the name of placeholder files created by --preserve-empty-dirs.
        Default: ".gitignore"
</p>
</dd>
</dl></div>
</dd>
<dt class="hdlist1">
<em>rebase</em>
</dt>
<dd>
<p>
        This fetches revisions from the SVN parent of the current HEAD
        and rebases the current (uncommitted to SVN) work against it.
</p>
<div class="paragraph"><p>This works similarly to <tt>svn update</tt> or <em>git pull</em> except that
it preserves linear history with <em>git rebase</em> instead of
<em>git merge</em> for ease of dcommitting with <em>git svn</em>.</p></div>
<div class="paragraph"><p>This accepts all options that <em>git svn fetch</em> and <em>git rebase</em>
accept.  However, <em>--fetch-all</em> only fetches from the current
[svn-remote], and not all [svn-remote] definitions.</p></div>
<div class="paragraph"><p>Like <em>git rebase</em>; this requires that the working tree be clean
and have no uncommitted changes.</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
-l
</dt>
<dt class="hdlist1">
--local
</dt>
<dd>
<p>
        Do not fetch remotely; only run <em>git rebase</em> against the
        last fetched commit from the upstream SVN.
</p>
</dd>
</dl></div>
</dd>
<dt class="hdlist1">
<em>dcommit</em>
</dt>
<dd>
<p>
        Commit each diff from the current branch directly to the SVN
        repository, and then rebase or reset (depending on whether or
        not there is a diff between SVN and head).  This will create
        a revision in SVN for each commit in git.
</p>
<div class="paragraph"><p>When an optional git branch name (or a git commit object name)
is specified as an argument, the subcommand works on the specified
branch, not on the current branch.</p></div>
<div class="paragraph"><p>Use of <em>dcommit</em> is preferred to <em>set-tree</em> (below).</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
--no-rebase
</dt>
<dd>
<p>
        After committing, do not rebase or reset.
</p>
</dd>
<dt class="hdlist1">
--commit-url &lt;URL&gt;
</dt>
<dd>
<p>
        Commit to this SVN URL (the full path).  This is intended to
        allow existing <em>git svn</em> repositories created with one transport
        method (e.g. <tt>svn://</tt> or <tt>http://</tt> for anonymous read) to be
        reused if a user is later given access to an alternate transport
        method (e.g. <tt>svn+ssh://</tt> or <tt>https://</tt>) for commit.
</p>
<div class="verseblock">
<div class="verseblock-content">config key: svn-remote.&lt;name&gt;.commiturl
config key: svn.commiturl (overwrites all svn-remote.&lt;name&gt;.commiturl options)</div>
<div class="verseblock-attribution">
</div></div>
<div class="paragraph"><p>Using this option for any other purpose (don&#8217;t ask) is very strongly
discouraged.</p></div>
</dd>
<dt class="hdlist1">
--mergeinfo=&lt;mergeinfo&gt;
</dt>
<dd>
<p>
        Add the given merge information during the dcommit
        (e.g. <tt>--mergeinfo="/branches/foo:1-10"</tt>). All svn server versions can
        store this information (as a property), and svn clients starting from
        version 1.5 can make use of it. To specify merge information from multiple
        branches, use a single space character between the branches
        (<tt>--mergeinfo="/branches/foo:1-10 /branches/bar:3,5-6,8"</tt>)
</p>
<div class="verseblock">
<div class="verseblock-content">config key: svn.pushmergeinfo</div>
<div class="verseblock-attribution">
</div></div>
<div class="paragraph"><p>This option will cause git-svn to attempt to automatically populate the
svn:mergeinfo property in the SVN repository when possible. Currently, this can
only be done when dcommitting non-fast-forward merges where all parents but the
first have already been pushed into SVN.</p></div>
</dd>
<dt class="hdlist1">
--interactive
</dt>
<dd>
<p>
        Ask the user to confirm that a patch set should actually be sent to SVN.
        For each patch, one may answer "yes" (accept this patch), "no" (discard this
        patch), "all" (accept all patches), or "quit".
       <br />
        <em>git svn dcommit</em> returns immediately if answer if "no" or "quit", without
        commiting anything to SVN.
</p>
</dd>
</dl></div>
</dd>
<dt class="hdlist1">
<em>branch</em>
</dt>
<dd>
<p>
        Create a branch in the SVN repository.
</p>
<div class="dlist"><dl>
<dt class="hdlist1">
-m
</dt>
<dt class="hdlist1">
--message
</dt>
<dd>
<p>
        Allows to specify the commit message.
</p>
</dd>
<dt class="hdlist1">
-t
</dt>
<dt class="hdlist1">
--tag
</dt>
<dd>
<p>
        Create a tag by using the tags_subdir instead of the branches_subdir
        specified during git svn init.
</p>
</dd>
<dt class="hdlist1">
-d
</dt>
<dt class="hdlist1">
--destination
</dt>
<dd>
<p>
        If more than one --branches (or --tags) option was given to the <em>init</em>
        or <em>clone</em> command, you must provide the location of the branch (or
        tag) you wish to create in the SVN repository.  The value of this
        option must match one of the paths specified by a --branches (or
        --tags) option.  You can see these paths with the commands
</p>
<div class="literalblock">
<div class="content">
<pre><tt>git config --get-all svn-remote.&lt;name&gt;.branches
git config --get-all svn-remote.&lt;name&gt;.tags</tt></pre>
</div></div>
<div class="paragraph"><p>where &lt;name&gt; is the name of the SVN repository as specified by the -R option to
<em>init</em> (or "svn" by default).</p></div>
</dd>
<dt class="hdlist1">
--username
</dt>
<dd>
<p>
        Specify the SVN username to perform the commit as.  This option overrides
        the <em>username</em> configuration property.
</p>
</dd>
<dt class="hdlist1">
--commit-url
</dt>
<dd>
<p>
        Use the specified URL to connect to the destination Subversion
        repository.  This is useful in cases where the source SVN
        repository is read-only.  This option overrides configuration
        property <em>commiturl</em>.
</p>
<div class="literalblock">
<div class="content">
<pre><tt>git config --get-all svn-remote.&lt;name&gt;.commiturl</tt></pre>
</div></div>
</dd>
</dl></div>
</dd>
<dt class="hdlist1">
<em>tag</em>
</dt>
<dd>
<p>
        Create a tag in the SVN repository. This is a shorthand for
        <em>branch -t</em>.
</p>
</dd>
<dt class="hdlist1">
<em>log</em>
</dt>
<dd>
<p>
        This should make it easy to look up svn log messages when svn
        users refer to -r/--revision numbers.
</p>
<div class="paragraph"><p>The following features from &#8216;svn log&#8217; are supported:</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
-r &lt;n&gt;[:&lt;n&gt;]
</dt>
<dt class="hdlist1">
--revision=&lt;n&gt;[:&lt;n&gt;]
</dt>
<dd>
<p>
        is supported, non-numeric args are not:
        HEAD, NEXT, BASE, PREV, etc &#8230;
</p>
</dd>
<dt class="hdlist1">
-v
</dt>
<dt class="hdlist1">
--verbose
</dt>
<dd>
<p>
        it&#8217;s not completely compatible with the --verbose
        output in svn log, but reasonably close.
</p>
</dd>
<dt class="hdlist1">
--limit=&lt;n&gt;
</dt>
<dd>
<p>
        is NOT the same as --max-count, doesn&#8217;t count
        merged/excluded commits
</p>
</dd>
<dt class="hdlist1">
--incremental
</dt>
<dd>
<p>
        supported
</p>
</dd>
</dl></div>
<div class="paragraph"><p>New features:</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
--show-commit
</dt>
<dd>
<p>
        shows the git commit sha1, as well
</p>
</dd>
<dt class="hdlist1">
--oneline
</dt>
<dd>
<p>
        our version of --pretty=oneline
</p>
</dd>
</dl></div>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<div class="title">Note</div>
</td>
<td class="content">SVN itself only stores times in UTC and nothing else. The regular svn
client converts the UTC time to the local time (or based on the TZ=
environment). This command has the same behaviour.</td>
</tr></table>
</div>
<div class="paragraph"><p>Any other arguments are passed directly to <em>git log</em></p></div>
</dd>
<dt class="hdlist1">
<em>blame</em>
</dt>
<dd>
<p>
       Show what revision and author last modified each line of a file. The
       output of this mode is format-compatible with the output of
       &#8216;svn blame&#8217; by default. Like the SVN blame command,
       local uncommitted changes in the working tree are ignored;
       the version of the file in the HEAD revision is annotated. Unknown
       arguments are passed directly to <em>git blame</em>.
</p>
<div class="dlist"><dl>
<dt class="hdlist1">
--git-format
</dt>
<dd>
<p>
        Produce output in the same format as <em>git blame</em>, but with
        SVN revision numbers instead of git commit hashes. In this mode,
        changes that haven&#8217;t been committed to SVN (including local
        working-copy edits) are shown as revision 0.
</p>
</dd>
</dl></div>
</dd>
<dt class="hdlist1">
<em>find-rev</em>
</dt>
<dd>
<p>
        When given an SVN revision number of the form <em>rN</em>, returns the
        corresponding git commit hash (this can optionally be followed by a
        tree-ish to specify which branch should be searched).  When given a
        tree-ish, returns the corresponding SVN revision number.
</p>
</dd>
<dt class="hdlist1">
<em>set-tree</em>
</dt>
<dd>
<p>
        You should consider using <em>dcommit</em> instead of this command.
        Commit specified commit or tree objects to SVN.  This relies on
        your imported fetch data being up-to-date.  This makes
        absolutely no attempts to do patching when committing to SVN, it
        simply overwrites files with those specified in the tree or
        commit.  All merging is assumed to have taken place
        independently of <em>git svn</em> functions.
</p>
</dd>
<dt class="hdlist1">
<em>create-ignore</em>
</dt>
<dd>
<p>
        Recursively finds the svn:ignore property on directories and
        creates matching .gitignore files. The resulting files are staged to
        be committed, but are not committed. Use -r/--revision to refer to a
        specific revision.
</p>
</dd>
<dt class="hdlist1">
<em>show-ignore</em>
</dt>
<dd>
<p>
        Recursively finds and lists the svn:ignore property on
        directories.  The output is suitable for appending to
        the $GIT_DIR/info/exclude file.
</p>
</dd>
<dt class="hdlist1">
<em>mkdirs</em>
</dt>
<dd>
<p>
        Attempts to recreate empty directories that core git cannot track
        based on information in $GIT_DIR/svn/&lt;refname&gt;/unhandled.log files.
        Empty directories are automatically recreated when using
        "git svn clone" and "git svn rebase", so "mkdirs" is intended
        for use after commands like "git checkout" or "git reset".
        (See the svn-remote.&lt;name&gt;.automkdirs config file option for
        more information.)
</p>
</dd>
<dt class="hdlist1">
<em>commit-diff</em>
</dt>
<dd>
<p>
        Commits the diff of two tree-ish arguments from the
        command-line.  This command does not rely on being inside an <tt>git svn
        init</tt>-ed repository.  This command takes three arguments, (a) the
        original tree to diff against, (b) the new tree result, (c) the
        URL of the target Subversion repository.  The final argument
        (URL) may be omitted if you are working from a <em>git svn</em>-aware
        repository (that has been <tt>init</tt>-ed with <em>git svn</em>).
        The -r&lt;revision&gt; option is required for this.
</p>
</dd>
<dt class="hdlist1">
<em>info</em>
</dt>
<dd>
<p>
        Shows information about a file or directory similar to what
        &#8216;svn info&#8217; provides.  Does not currently support a -r/--revision
        argument.  Use the --url option to output only the value of the
        <em>URL:</em> field.
</p>
</dd>
<dt class="hdlist1">
<em>proplist</em>
</dt>
<dd>
<p>
        Lists the properties stored in the Subversion repository about a
        given file or directory.  Use -r/--revision to refer to a specific
        Subversion revision.
</p>
</dd>
<dt class="hdlist1">
<em>propget</em>
</dt>
<dd>
<p>
        Gets the Subversion property given as the first argument, for a
        file.  A specific revision can be specified with -r/--revision.
</p>
</dd>
<dt class="hdlist1">
<em>show-externals</em>
</dt>
<dd>
<p>
        Shows the Subversion externals.  Use -r/--revision to specify a
        specific revision.
</p>
</dd>
<dt class="hdlist1">
<em>gc</em>
</dt>
<dd>
<p>
        Compress $GIT_DIR/svn/&lt;refname&gt;/unhandled.log files in .git/svn
        and remove $GIT_DIR/svn/&lt;refname&gt;index files in .git/svn.
</p>
</dd>
<dt class="hdlist1">
<em>reset</em>
</dt>
<dd>
<p>
        Undoes the effects of <em>fetch</em> back to the specified revision.
        This allows you to re-<em>fetch</em> an SVN revision.  Normally the
        contents of an SVN revision should never change and <em>reset</em>
        should not be necessary.  However, if SVN permissions change,
        or if you alter your --ignore-paths option, a <em>fetch</em> may fail
        with "not found in commit" (file not previously visible) or
        "checksum mismatch" (missed a modification).  If the problem
        file cannot be ignored forever (with --ignore-paths) the only
        way to repair the repo is to use <em>reset</em>.
</p>
<div class="paragraph"><p>Only the rev_map and refs/remotes/git-svn are changed.  Follow <em>reset</em>
with a <em>fetch</em> and then <em>git reset</em> or <em>git rebase</em> to move local
branches onto the new tree.</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
-r &lt;n&gt;
</dt>
<dt class="hdlist1">
--revision=&lt;n&gt;
</dt>
<dd>
<p>
        Specify the most recent revision to keep.  All later revisions
        are discarded.
</p>
</dd>
<dt class="hdlist1">
-p
</dt>
<dt class="hdlist1">
--parent
</dt>
<dd>
<p>
        Discard the specified revision as well, keeping the nearest
        parent instead.
</p>
</dd>
<dt class="hdlist1">
Example:
</dt>
<dd>
<p>
Assume you have local changes in "master", but you need to refetch "r2".
</p>
<div class="listingblock">
<div class="content">
<pre><tt>    r1---r2---r3 remotes/git-svn
                \
                 A---B master</tt></pre>
</div></div>
<div class="paragraph"><p>Fix the ignore-paths or SVN permissions problem that caused "r2" to
be incomplete in the first place.  Then:</p></div>
<div class="verseblock">
<div class="verseblock-content">git svn reset -r2 -p
git svn fetch</div>
<div class="verseblock-attribution">
</div></div>
<div class="listingblock">
<div class="content">
<pre><tt>    r1---r2'--r3' remotes/git-svn
      \
       r2---r3---A---B master</tt></pre>
</div></div>
<div class="paragraph"><p>Then fixup "master" with <em>git rebase</em>.
Do NOT use <em>git merge</em> or your history will not be compatible with a
future <em>dcommit</em>!</p></div>
<div class="verseblock">
<div class="verseblock-content">git rebase --onto remotes/git-svn A^ master</div>
<div class="verseblock-attribution">
</div></div>
<div class="listingblock">
<div class="content">
<pre><tt>    r1---r2'--r3' remotes/git-svn
                \
                 A'--B' master</tt></pre>
</div></div>
</dd>
</dl></div>
</dd>
</dl></div>
</div>
<h2 id="_options">OPTIONS</h2>
<div class="sectionbody">
<div class="dlist"><dl>
<dt class="hdlist1">
--shared[=(false|true|umask|group|all|world|everybody)]
</dt>
<dt class="hdlist1">
--template=&lt;template_directory&gt;
</dt>
<dd>
<p>
        Only used with the <em>init</em> command.
        These are passed directly to <em>git init</em>.
</p>
</dd>
<dt class="hdlist1">
-r &lt;arg&gt;
</dt>
<dt class="hdlist1">
--revision &lt;arg&gt;
</dt>
<dd>
<p>
           Used with the <em>fetch</em> command.
</p>
<div class="paragraph"><p>This allows revision ranges for partial/cauterized history
to be supported.  $NUMBER, $NUMBER1:$NUMBER2 (numeric ranges),
$NUMBER:HEAD, and BASE:$NUMBER are all supported.</p></div>
<div class="paragraph"><p>This can allow you to make partial mirrors when running fetch;
but is generally not recommended because history will be skipped
and lost.</p></div>
</dd>
<dt class="hdlist1">
-
</dt>
<dt class="hdlist1">
--stdin
</dt>
<dd>
<p>
        Only used with the <em>set-tree</em> command.
</p>
<div class="paragraph"><p>Read a list of commits from stdin and commit them in reverse
order.  Only the leading sha1 is read from each line, so
<em>git rev-list --pretty=oneline</em> output can be used.</p></div>
</dd>
<dt class="hdlist1">
--rmdir
</dt>
<dd>
<p>
        Only used with the <em>dcommit</em>, <em>set-tree</em> and <em>commit-diff</em> commands.
</p>
<div class="paragraph"><p>Remove directories from the SVN tree if there are no files left
behind.  SVN can version empty directories, and they are not
removed by default if there are no files left in them.  git
cannot version empty directories.  Enabling this flag will make
the commit to SVN act like git.</p></div>
<div class="verseblock">
<div class="verseblock-content">config key: svn.rmdir</div>
<div class="verseblock-attribution">
</div></div>
</dd>
<dt class="hdlist1">
-e
</dt>
<dt class="hdlist1">
--edit
</dt>
<dd>
<p>
        Only used with the <em>dcommit</em>, <em>set-tree</em> and <em>commit-diff</em> commands.
</p>
<div class="paragraph"><p>Edit the commit message before committing to SVN.  This is off by
default for objects that are commits, and forced on when committing
tree objects.</p></div>
<div class="verseblock">
<div class="verseblock-content">config key: svn.edit</div>
<div class="verseblock-attribution">
</div></div>
</dd>
<dt class="hdlist1">
-l&lt;num&gt;
</dt>
<dt class="hdlist1">
--find-copies-harder
</dt>
<dd>
<p>
        Only used with the <em>dcommit</em>, <em>set-tree</em> and <em>commit-diff</em> commands.
</p>
<div class="paragraph"><p>They are both passed directly to <em>git diff-tree</em>; see
<a href="git-diff-tree.html">git-diff-tree(1)</a> for more information.</p></div>
<div class="verseblock">
<div class="verseblock-content">config key: svn.l
config key: svn.findcopiesharder</div>
<div class="verseblock-attribution">
</div></div>
</dd>
<dt class="hdlist1">
-A&lt;filename&gt;
</dt>
<dt class="hdlist1">
--authors-file=&lt;filename&gt;
</dt>
<dd>
<p>
        Syntax is compatible with the file used by <em>git cvsimport</em>:
</p>
<div class="listingblock">
<div class="content">
<pre><tt>        loginname = Joe User &lt;user@example.com&gt;</tt></pre>
</div></div>
<div class="paragraph"><p>If this option is specified and <em>git svn</em> encounters an SVN
committer name that does not exist in the authors-file, <em>git svn</em>
will abort operation. The user will then have to add the
appropriate entry.  Re-running the previous <em>git svn</em> command
after the authors-file is modified should continue operation.</p></div>
<div class="verseblock">
<div class="verseblock-content">config key: svn.authorsfile</div>
<div class="verseblock-attribution">
</div></div>
</dd>
<dt class="hdlist1">
--authors-prog=&lt;filename&gt;
</dt>
<dd>
<p>
        If this option is specified, for each SVN committer name that
        does not exist in the authors file, the given file is executed
        with the committer name as the first argument.  The program is
        expected to return a single line of the form "Name &lt;email&gt;",
        which will be treated as if included in the authors file.
</p>
</dd>
<dt class="hdlist1">
-q
</dt>
<dt class="hdlist1">
--quiet
</dt>
<dd>
<p>
        Make <em>git svn</em> less verbose. Specify a second time to make it
        even less verbose.
</p>
</dd>
<dt class="hdlist1">
--repack[=&lt;n&gt;]
</dt>
<dt class="hdlist1">
--repack-flags=&lt;flags&gt;
</dt>
<dd>
<p>
        These should help keep disk usage sane for large fetches with
        many revisions.
</p>
<div class="paragraph"><p>--repack takes an optional argument for the number of revisions
to fetch before repacking.  This defaults to repacking every
1000 commits fetched if no argument is specified.</p></div>
<div class="paragraph"><p>--repack-flags are passed directly to <em>git repack</em>.</p></div>
<div class="verseblock">
<div class="verseblock-content">config key: svn.repack
config key: svn.repackflags</div>
<div class="verseblock-attribution">
</div></div>
</dd>
<dt class="hdlist1">
-m
</dt>
<dt class="hdlist1">
--merge
</dt>
<dt class="hdlist1">
-s&lt;strategy&gt;
</dt>
<dt class="hdlist1">
--strategy=&lt;strategy&gt;
</dt>
<dt class="hdlist1">
-p
</dt>
<dt class="hdlist1">
--preserve-merges
</dt>
<dd>
<p>
        These are only used with the <em>dcommit</em> and <em>rebase</em> commands.
</p>
<div class="paragraph"><p>Passed directly to <em>git rebase</em> when using <em>dcommit</em> if a
<em>git reset</em> cannot be used (see <em>dcommit</em>).</p></div>
</dd>
<dt class="hdlist1">
-n
</dt>
<dt class="hdlist1">
--dry-run
</dt>
<dd>
<p>
        This can be used with the <em>dcommit</em>, <em>rebase</em>, <em>branch</em> and
        <em>tag</em> commands.
</p>
<div class="paragraph"><p>For <em>dcommit</em>, print out the series of git arguments that would show
which diffs would be committed to SVN.</p></div>
<div class="paragraph"><p>For <em>rebase</em>, display the local branch associated with the upstream svn
repository associated with the current branch and the URL of svn
repository that will be fetched from.</p></div>
<div class="paragraph"><p>For <em>branch</em> and <em>tag</em>, display the urls that will be used for copying when
creating the branch or tag.</p></div>
</dd>
<dt class="hdlist1">
--use-log-author
</dt>
<dd>
<p>
        When retrieving svn commits into git (as part of <em>fetch</em>, <em>rebase</em>, or
        <em>dcommit</em> operations), look for the first <tt>From:</tt> or <tt>Signed-off-by:</tt> line
        in the log message and use that as the author string.
</p>
</dd>
<dt class="hdlist1">
--add-author-from
</dt>
<dd>
<p>
        When committing to svn from git (as part of <em>commit-diff</em>, <em>set-tree</em> or <em>dcommit</em>
        operations), if the existing log message doesn&#8217;t already have a
        <tt>From:</tt> or <tt>Signed-off-by:</tt> line, append a <tt>From:</tt> line based on the
        git commit&#8217;s author string.  If you use this, then <tt>--use-log-author</tt>
        will retrieve a valid author string for all commits.
</p>
</dd>
</dl></div>
</div>
<h2 id="_advanced_options">ADVANCED OPTIONS</h2>
<div class="sectionbody">
<div class="dlist"><dl>
<dt class="hdlist1">
-i&lt;GIT_SVN_ID&gt;
</dt>
<dt class="hdlist1">
--id &lt;GIT_SVN_ID&gt;
</dt>
<dd>
<p>
        This sets GIT_SVN_ID (instead of using the environment).  This
        allows the user to override the default refname to fetch from
        when tracking a single URL.  The <em>log</em> and <em>dcommit</em> commands
        no longer require this switch as an argument.
</p>
</dd>
<dt class="hdlist1">
-R&lt;remote name&gt;
</dt>
<dt class="hdlist1">
--svn-remote &lt;remote name&gt;
</dt>
<dd>
<p>
        Specify the [svn-remote "&lt;remote name&gt;"] section to use,
        this allows SVN multiple repositories to be tracked.
        Default: "svn"
</p>
</dd>
<dt class="hdlist1">
--follow-parent
</dt>
<dd>
<p>
        This is especially helpful when we&#8217;re tracking a directory
        that has been moved around within the repository, or if we
        started tracking a branch and never tracked the trunk it was
        descended from. This feature is enabled by default, use
        --no-follow-parent to disable it.
</p>
<div class="verseblock">
<div class="verseblock-content">config key: svn.followparent</div>
<div class="verseblock-attribution">
</div></div>
</dd>
</dl></div>
</div>
<h2 id="_config_file_only_options">CONFIG FILE-ONLY OPTIONS</h2>
<div class="sectionbody">
<div class="dlist"><dl>
<dt class="hdlist1">
svn.noMetadata
</dt>
<dt class="hdlist1">
svn-remote.&lt;name&gt;.noMetadata
</dt>
<dd>
<p>
        This gets rid of the <em>git-svn-id:</em> lines at the end of every commit.
</p>
<div class="paragraph"><p>This option can only be used for one-shot imports as <em>git svn</em>
will not be able to fetch again without metadata. Additionally,
if you lose your .git/svn/<strong>*/.rev_map.</strong> files, <em>git svn</em> will not
be able to rebuild them.</p></div>
<div class="paragraph"><p>The <em>git svn log</em> command will not work on repositories using
this, either.  Using this conflicts with the <em>useSvmProps</em>
option for (hopefully) obvious reasons.</p></div>
<div class="paragraph"><p>This option is NOT recommended as it makes it difficult to track down
old references to SVN revision numbers in existing documentation, bug
reports and archives.  If you plan to eventually migrate from SVN to git
and are certain about dropping SVN history, consider
<a href="git-filter-branch.html">git-filter-branch(1)</a> instead.  filter-branch also allows
reformatting of metadata for ease-of-reading and rewriting authorship
info for non-"svn.authorsFile" users.</p></div>
</dd>
<dt class="hdlist1">
svn.useSvmProps
</dt>
<dt class="hdlist1">
svn-remote.&lt;name&gt;.useSvmProps
</dt>
<dd>
<p>
        This allows <em>git svn</em> to re-map repository URLs and UUIDs from
        mirrors created using SVN::Mirror (or svk) for metadata.
</p>
<div class="paragraph"><p>If an SVN revision has a property, "svm:headrev", it is likely
that the revision was created by SVN::Mirror (also used by SVK).
The property contains a repository UUID and a revision.  We want
to make it look like we are mirroring the original URL, so
introduce a helper function that returns the original identity
URL and UUID, and use it when generating metadata in commit
messages.</p></div>
</dd>
<dt class="hdlist1">
svn.useSvnsyncProps
</dt>
<dt class="hdlist1">
svn-remote.&lt;name&gt;.useSvnsyncprops
</dt>
<dd>
<p>
        Similar to the useSvmProps option; this is for users
        of the svnsync(1) command distributed with SVN 1.4.x and
        later.
</p>
</dd>
<dt class="hdlist1">
svn-remote.&lt;name&gt;.rewriteRoot
</dt>
<dd>
<p>
        This allows users to create repositories from alternate
        URLs.  For example, an administrator could run <em>git svn</em> on the
        server locally (accessing via file://) but wish to distribute
        the repository with a public http:// or svn:// URL in the
        metadata so users of it will see the public URL.
</p>
</dd>
<dt class="hdlist1">
svn-remote.&lt;name&gt;.rewriteUUID
</dt>
<dd>
<p>
        Similar to the useSvmProps option; this is for users who need
        to remap the UUID manually. This may be useful in situations
        where the original UUID is not available via either useSvmProps
        or useSvnsyncProps.
</p>
</dd>
<dt class="hdlist1">
svn-remote.&lt;name&gt;.pushurl
</dt>
<dd>
<p>
        Similar to git&#8217;s <em>remote.&lt;name&gt;.pushurl</em>, this key is designed
        to be used in cases where <em>url</em> points to an SVN repository
        via a read-only transport, to provide an alternate read/write
        transport. It is assumed that both keys point to the same
        repository. Unlike <em>commiturl</em>, <em>pushurl</em> is a base path. If
        either <em>commiturl</em> or <em>pushurl</em> could be used, <em>commiturl</em>
        takes precedence.
</p>
</dd>
<dt class="hdlist1">
svn.brokenSymlinkWorkaround
</dt>
<dd>
<p>
        This disables potentially expensive checks to workaround
        broken symlinks checked into SVN by broken clients.  Set this
        option to "false" if you track a SVN repository with many
        empty blobs that are not symlinks.  This option may be changed
        while <em>git svn</em> is running and take effect on the next
        revision fetched.  If unset, <em>git svn</em> assumes this option to
        be "true".
</p>
</dd>
<dt class="hdlist1">
svn.pathnameencoding
</dt>
<dd>
<p>
        This instructs git svn to recode pathnames to a given encoding.
        It can be used by windows users and by those who work in non-utf8
        locales to avoid corrupted file names with non-ASCII characters.
        Valid encodings are the ones supported by Perl&#8217;s Encode module.
</p>
</dd>
<dt class="hdlist1">
svn-remote.&lt;name&gt;.automkdirs
</dt>
<dd>
<p>
        Normally, the "git svn clone" and "git svn rebase" commands
        attempt to recreate empty directories that are in the
        Subversion repository.  If this option is set to "false", then
        empty directories will only be created if the "git svn mkdirs"
        command is run explicitly.  If unset, <em>git svn</em> assumes this
        option to be "true".
</p>
</dd>
</dl></div>
<div class="paragraph"><p>Since the noMetadata, rewriteRoot, rewriteUUID, useSvnsyncProps and useSvmProps
options all affect the metadata generated and used by <em>git svn</em>; they
<strong>must</strong> be set in the configuration file before any history is imported
and these settings should never be changed once they are set.</p></div>
<div class="paragraph"><p>Additionally, only one of these options can be used per svn-remote
section because they affect the <em>git-svn-id:</em> metadata line, except
for rewriteRoot and rewriteUUID which can be used together.</p></div>
</div>
<h2 id="_basic_examples">BASIC EXAMPLES</h2>
<div class="sectionbody">
<div class="paragraph"><p>Tracking and contributing to the trunk of a Subversion-managed project:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt># Clone a repo (like git clone):
        git svn clone http://svn.example.com/project/trunk
# Enter the newly cloned directory:
        cd trunk
# You should be on master branch, double-check with 'git branch'
        git branch
# Do some work and commit locally to git:
        git commit ...
# Something is committed to SVN, rebase your local changes against the
# latest changes in SVN:
        git svn rebase
# Now commit your changes (that were committed previously using git) to SVN,
# as well as automatically updating your working HEAD:
        git svn dcommit
# Append svn:ignore settings to the default git exclude file:
        git svn show-ignore &gt;&gt; .git/info/exclude</tt></pre>
</div></div>
<div class="paragraph"><p>Tracking and contributing to an entire Subversion-managed project
(complete with a trunk, tags and branches):</p></div>
<div class="listingblock">
<div class="content">
<pre><tt># Clone a repo (like git clone):
        git svn clone http://svn.example.com/project -T trunk -b branches -t tags
# View all branches and tags you have cloned:
        git branch -r
# Create a new branch in SVN
    git svn branch waldo
# Reset your master to trunk (or any other branch, replacing 'trunk'
# with the appropriate name):
        git reset --hard remotes/trunk
# You may only dcommit to one branch/tag/trunk at a time.  The usage
# of dcommit/rebase/show-ignore should be the same as above.</tt></pre>
</div></div>
<div class="paragraph"><p>The initial <em>git svn clone</em> can be quite time-consuming
(especially for large Subversion repositories). If multiple
people (or one person with multiple machines) want to use
<em>git svn</em> to interact with the same Subversion repository, you can
do the initial <em>git svn clone</em> to a repository on a server and
have each person clone that repository with <em>git clone</em>:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt># Do the initial import on a server
        ssh server "cd /pub &amp;&amp; git svn clone http://svn.example.com/project
# Clone locally - make sure the refs/remotes/ space matches the server
        mkdir project
        cd project
        git init
        git remote add origin server:/pub/project
        git config --replace-all remote.origin.fetch '+refs/remotes/*:refs/remotes/*'
        git fetch
# Prevent fetch/pull from remote git server in the future,
# we only want to use git svn for future updates
        git config --remove-section remote.origin
# Create a local branch from one of the branches just fetched
        git checkout -b master FETCH_HEAD
# Initialize 'git svn' locally (be sure to use the same URL and -T/-b/-t options as were used on server)
        git svn init http://svn.example.com/project
# Pull the latest changes from Subversion
        git svn rebase</tt></pre>
</div></div>
</div>
<h2 id="_rebase_vs_pull_merge">REBASE VS. PULL/MERGE</h2>
<div class="sectionbody">
<div class="paragraph"><p>Prefer to use <em>git svn rebase</em> or <em>git rebase</em>, rather than
<em>git pull</em> or <em>git merge</em> to synchronize unintegrated commits with a <em>git svn</em>
branch. Doing so will keep the history of unintegrated commits linear with
respect to the upstream SVN repository and allow the use of the preferred
<em>git svn dcommit</em> subcommand to push unintegrated commits back into SVN.</p></div>
<div class="paragraph"><p>Originally, <em>git svn</em> recommended that developers pulled or merged from
the <em>git svn</em> branch.  This was because the author favored
<tt>git svn set-tree B</tt> to commit a single head rather than the
<tt>git svn set-tree A..B</tt> notation to commit multiple commits. Use of
<em>git pull</em> or <em>git merge</em> with <tt>git svn set-tree A..B</tt> will cause non-linear
history to be flattened when committing into SVN and this can lead to merge
commits unexpectedly reversing previous commits in SVN.</p></div>
</div>
<h2 id="_merge_tracking">MERGE TRACKING</h2>
<div class="sectionbody">
<div class="paragraph"><p>While <em>git svn</em> can track
copy history (including branches and tags) for repositories adopting a
standard layout, it cannot yet represent merge history that happened
inside git back upstream to SVN users.  Therefore it is advised that
users keep history as linear as possible inside git to ease
compatibility with SVN (see the CAVEATS section below).</p></div>
</div>
<h2 id="_caveats">CAVEATS</h2>
<div class="sectionbody">
<div class="paragraph"><p>For the sake of simplicity and interoperating with Subversion,
it is recommended that all <em>git svn</em> users clone, fetch and dcommit
directly from the SVN server, and avoid all <em>git clone</em>/<em>pull</em>/<em>merge</em>/<em>push</em>
operations between git repositories and branches.  The recommended
method of exchanging code between git branches and users is
<em>git format-patch</em> and <em>git am</em>, or just 'dcommit&#8217;ing to the SVN repository.</p></div>
<div class="paragraph"><p>Running <em>git merge</em> or <em>git pull</em> is NOT recommended on a branch you
plan to <em>dcommit</em> from because Subversion users cannot see any
merges you&#8217;ve made.  Furthermore, if you merge or pull from a git branch
that is a mirror of an SVN branch, <em>dcommit</em> may commit to the wrong
branch.</p></div>
<div class="paragraph"><p>If you do merge, note the following rule: <em>git svn dcommit</em> will
attempt to commit on top of the SVN commit named in</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>git log --grep=^git-svn-id: --first-parent -1</tt></pre>
</div></div>
<div class="paragraph"><p>You <em>must</em> therefore ensure that the most recent commit of the branch
you want to dcommit to is the <em>first</em> parent of the merge.  Chaos will
ensue otherwise, especially if the first parent is an older commit on
the same SVN branch.</p></div>
<div class="paragraph"><p><em>git clone</em> does not clone branches under the refs/remotes/ hierarchy or
any <em>git svn</em> metadata, or config.  So repositories created and managed with
using <em>git svn</em> should use <em>rsync</em> for cloning, if cloning is to be done
at all.</p></div>
<div class="paragraph"><p>Since <em>dcommit</em> uses rebase internally, any git branches you <em>git push</em> to
before <em>dcommit</em> on will require forcing an overwrite of the existing ref
on the remote repository.  This is generally considered bad practice,
see the <a href="git-push.html">git-push(1)</a> documentation for details.</p></div>
<div class="paragraph"><p>Do not use the --amend option of <a href="git-commit.html">git-commit(1)</a> on a change you&#8217;ve
already dcommitted.  It is considered bad practice to --amend commits
you&#8217;ve already pushed to a remote repository for other users, and
dcommit with SVN is analogous to that.</p></div>
<div class="paragraph"><p>When using multiple --branches or --tags, <em>git svn</em> does not automatically
handle name collisions (for example, if two branches from different paths have
the same name, or if a branch and a tag have the same name).  In these cases,
use <em>init</em> to set up your git repository then, before your first <em>fetch</em>, edit
the .git/config file so that the branches and tags are associated with
different name spaces.  For example:</p></div>
<div class="literalblock">
<div class="content">
<pre><tt>branches = stable/*:refs/remotes/svn/stable/*
branches = debug/*:refs/remotes/svn/debug/*</tt></pre>
</div></div>
</div>
<h2 id="_bugs">BUGS</h2>
<div class="sectionbody">
<div class="paragraph"><p>We ignore all SVN properties except svn:executable.  Any unhandled
properties are logged to $GIT_DIR/svn/&lt;refname&gt;/unhandled.log</p></div>
<div class="paragraph"><p>Renamed and copied directories are not detected by git and hence not
tracked when committing to SVN.  I do not plan on adding support for
this as it&#8217;s quite difficult and time-consuming to get working for all
the possible corner cases (git doesn&#8217;t do it, either).  Committing
renamed and copied files is fully supported if they&#8217;re similar enough
for git to detect them.</p></div>
</div>
<h2 id="_configuration">CONFIGURATION</h2>
<div class="sectionbody">
<div class="paragraph"><p><em>git svn</em> stores [svn-remote] configuration information in the
repository .git/config file.  It is similar the core git
[remote] sections except <em>fetch</em> keys do not accept glob
arguments; but they are instead handled by the <em>branches</em>
and <em>tags</em> keys.  Since some SVN repositories are oddly
configured with multiple projects glob expansions such those
listed below are allowed:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>[svn-remote "project-a"]
        url = http://server.org/svn
        fetch = trunk/project-a:refs/remotes/project-a/trunk
        branches = branches/*/project-a:refs/remotes/project-a/branches/*
        tags = tags/*/project-a:refs/remotes/project-a/tags/*</tt></pre>
</div></div>
<div class="paragraph"><p>Keep in mind that the <em>*</em> (asterisk) wildcard of the local ref
(right of the <em>:</em>) <strong>must</strong> be the farthest right path component;
however the remote wildcard may be anywhere as long as it&#8217;s an
independent path component (surrounded by <em>/</em> or EOL).   This
type of configuration is not automatically created by <em>init</em> and
should be manually entered with a text-editor or using <em>git config</em>.</p></div>
<div class="paragraph"><p>It is also possible to fetch a subset of branches or tags by using a
comma-separated list of names within braces. For example:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>[svn-remote "huge-project"]
        url = http://server.org/svn
        fetch = trunk/src:refs/remotes/trunk
        branches = branches/{red,green}/src:refs/remotes/branches/*
        tags = tags/{1.0,2.0}/src:refs/remotes/tags/*</tt></pre>
</div></div>
<div class="paragraph"><p>Note that git-svn keeps track of the highest revision in which a branch
or tag has appeared. If the subset of branches or tags is changed after
fetching, then .git/svn/.metadata must be manually edited to remove (or
reset) branches-maxRev and/or tags-maxRev as appropriate.</p></div>
</div>
<h2 id="_see_also">SEE ALSO</h2>
<div class="sectionbody">
<div class="paragraph"><p><a href="git-rebase.html">git-rebase(1)</a></p></div>
</div>
<h2 id="_git">GIT</h2>
<div class="sectionbody">
<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
</div>
</div>
<div id="footnotes"><hr /></div>
<div id="footer">
<div id="footer-text">
Last updated 2012-05-17 15:54:44 PDT
</div>
</div>
</body>
</html>