| <!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.2.5" /> | |
| <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; | |
| } | |
| strong { | |
| font-weight: bold; | |
| } | |
| 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; | |
| } | |
| pre { | |
| padding: 0; | |
| margin: 0; | |
| } | |
| span#author { | |
| color: #527bbd; | |
| font-family: sans-serif; | |
| font-weight: bold; | |
| font-size: 1.1em; | |
| } | |
| span#email { | |
| } | |
| span#revision { | |
| 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, | |
| div.tableblock, div.imageblock, div.exampleblock, div.verseblock, | |
| div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock, | |
| div.admonitionblock { | |
| margin-right: 10%; | |
| margin-top: 1.5em; | |
| margin-bottom: 1.5em; | |
| } | |
| div.admonitionblock { | |
| margin-top: 2.5em; | |
| margin-bottom: 2.5em; | |
| } | |
| div.content { /* Block element content. */ | |
| padding: 0; | |
| } | |
| /* Block element titles. */ | |
| div.title, caption.title { | |
| 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 { | |
| margin-right: 0%; | |
| } | |
| div.listingblock > div.content { | |
| border: 1px solid silver; | |
| background: #f4f4f4; | |
| padding: 0.5em; | |
| } | |
| div.quoteblock > div.content { | |
| padding-left: 2.0em; | |
| } | |
| div.attribution { | |
| text-align: right; | |
| } | |
| 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: 2px solid silver; | |
| } | |
| div.exampleblock > div.content { | |
| border-left: 2px solid silver; | |
| padding: 0.5em; | |
| } | |
| div.verseblock div.content { | |
| white-space: pre; | |
| } | |
| div.imageblock div.content { padding-left: 0; } | |
| div.imageblock img { border: 1px solid silver; } | |
| span.image img { border-style: none; } | |
| dl { | |
| margin-top: 0.8em; | |
| margin-bottom: 0.8em; | |
| } | |
| dt { | |
| margin-top: 0.5em; | |
| margin-bottom: 0; | |
| font-style: italic; | |
| } | |
| dd > *:first-child { | |
| margin-top: 0; | |
| } | |
| ul, ol { | |
| list-style-position: outside; | |
| } | |
| div.olist2 ol { | |
| list-style-type: lower-alpha; | |
| } | |
| div.tableblock > table { | |
| border: 3px solid #527bbd; | |
| } | |
| thead { | |
| font-family: sans-serif; | |
| font-weight: bold; | |
| } | |
| tfoot { | |
| font-weight: bold; | |
| } | |
| div.hlist { | |
| margin-top: 0.8em; | |
| margin-bottom: 0.8em; | |
| } | |
| div.hlist td { | |
| padding-bottom: 5px; | |
| } | |
| td.hlist1 { | |
| vertical-align: top; | |
| font-style: italic; | |
| padding-right: 0.8em; | |
| } | |
| td.hlist2 { | |
| vertical-align: top; | |
| } | |
| @media print { | |
| div#footer-badges { display: none; } | |
| } | |
| 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; | |
| } | |
| include1::./stylesheets/xhtml11-manpage.css[] | |
| /* 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 { | |
| 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-content { | |
| padding-left: 2.0em; | |
| } | |
| div.exampleblock-content { | |
| border-left: 2px solid silver; | |
| padding-left: 0.5em; | |
| } | |
| /* IE6 sets dynamically generated links as visited. */ | |
| div#toc a:visited { color: blue; } | |
| </style> | |
| <title>git-svn(1)</title> | |
| </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 single Subversion branch and git | |
| </p> | |
| </div> | |
| </div> | |
| <h2>SYNOPSIS</h2> | |
| <div class="sectionbody"> | |
| <div class="para"><p><em>git svn</em> <command> [options] [arguments]</p></div> | |
| </div> | |
| <h2 id="_description">DESCRIPTION</h2> | |
| <div class="sectionbody"> | |
| <div class="para"><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="para"><p><em>git-svn</em> can track a single Subversion branch simply by using a | |
| URL to the branch, follow branches laid out in the Subversion recommended | |
| method (trunk, branches, tags directories) with the --stdlayout option, or | |
| follow branches 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="para"><p>Once tracking a Subversion branch (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="vlist"><dl> | |
| <dt> | |
| <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="vlist"><dl> | |
| <dt> | |
| -T<trunk_subdir> | |
| </dt> | |
| <dt> | |
| --trunk=<trunk_subdir> | |
| </dt> | |
| <dt> | |
| -t<tags_subdir> | |
| </dt> | |
| <dt> | |
| --tags=<tags_subdir> | |
| </dt> | |
| <dt> | |
| -b<branches_subdir> | |
| </dt> | |
| <dt> | |
| --branches=<branches_subdir> | |
| </dt> | |
| <dt> | |
| -s | |
| </dt> | |
| <dt> | |
| --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). 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> | |
| --no-metadata | |
| </dt> | |
| <dd> | |
| <p> | |
| Set the <em>noMetadata</em> option in the [svn-remote] config. | |
| </p> | |
| </dd> | |
| <dt> | |
| --use-svm-props | |
| </dt> | |
| <dd> | |
| <p> | |
| Set the <em>useSvmProps</em> option in the [svn-remote] config. | |
| </p> | |
| </dd> | |
| <dt> | |
| --use-svnsync-props | |
| </dt> | |
| <dd> | |
| <p> | |
| Set the <em>useSvnsyncProps</em> option in the [svn-remote] config. | |
| </p> | |
| </dd> | |
| <dt> | |
| --rewrite-root=<URL> | |
| </dt> | |
| <dd> | |
| <p> | |
| Set the <em>rewriteRoot</em> option in the [svn-remote] config. | |
| </p> | |
| </dd> | |
| <dt> | |
| --use-log-author | |
| </dt> | |
| <dd> | |
| <p> | |
| When retrieving svn commits into git (as part of fetch, rebase, or | |
| dcommit operations), look for the first From: or Signed-off-by: line | |
| in the log message and use that as the author string. | |
| </p> | |
| </dd> | |
| <dt> | |
| --add-author-from | |
| </dt> | |
| <dd> | |
| <p> | |
| When committing to svn from git (as part of commit or dcommit | |
| operations), if the existing log message doesn't already have a | |
| From: or Signed-off-by: line, append a From: line based on the | |
| git commit's author string. If you use this, then --use-log-author | |
| will retrieve a valid author string for all commits. | |
| </p> | |
| </dd> | |
| <dt> | |
| --username=<USER> | |
| </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> | |
| --prefix=<prefix> | |
| </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> | |
| --ignore-paths=<regex> | |
| </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> | |
| </dl></div> | |
| </dd> | |
| <dt> | |
| <em>fetch</em> | |
| </dt> | |
| <dd> | |
| <p> | |
| Fetch unfetched revisions from the Subversion remote we are | |
| tracking. The name of the [svn-remote "…"] section in the | |
| .git/config file may be specified as an optional command-line | |
| argument. | |
| </p> | |
| <div class="vlist"><dl> | |
| <dt> | |
| --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> | |
| </dd> | |
| <dt> | |
| --parent | |
| </dt> | |
| <dd> | |
| <p> | |
| Fetch only from the SVN parent of the current HEAD. | |
| </p> | |
| <div class="para"><p>This doesn'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's local Git | |
| repository, either don't use this option or you should both use it in | |
| the same local timezone.</p></div> | |
| </dd> | |
| <dt> | |
| --ignore-paths=<regex> | |
| </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="para"><p>config key: svn-remote.<name>.ignore-paths</p></div> | |
| <div class="literalblock"> | |
| <div class="content"> | |
| <pre><tt>If the ignore-paths config key is set and the command | |
| line option is also given, both regular expressions | |
| will be used.</tt></pre> | |
| </div></div> | |
| <div class="para"><p>Examples:</p></div> | |
| <div class="literalblock"> | |
| <div class="content"> | |
| <pre><tt>--ignore-paths="^doc" - skip "doc*" directory for every | |
| fetch.</tt></pre> | |
| </div></div> | |
| <div class="literalblock"> | |
| <div class="content"> | |
| <pre><tt>--ignore-paths="^[^/]+/(?:branches|tags)" - skip | |
| "branches" and "tags" of first level directories.</tt></pre> | |
| </div></div> | |
| </dd> | |
| </dl></div> | |
| </dd> | |
| <dt> | |
| <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>. 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> | |
| </dd> | |
| <dt> | |
| <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="para"><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="para"><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="para"><p>Like <em>git-rebase</em>; this requires that the working tree be clean | |
| and have no uncommitted changes.</p></div> | |
| <div class="vlist"><dl> | |
| <dt> | |
| -l | |
| </dt> | |
| <dt> | |
| --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> | |
| <em>dcommit</em> | |
| </dt> | |
| <dd> | |
| <p> | |
| Commit each diff from a specified head 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. | |
| It is recommended that you run <em>git-svn</em> fetch and rebase (not | |
| pull or merge) your commits against the latest changes in the | |
| SVN repository. | |
| An optional command-line argument may be specified as an | |
| alternative to HEAD. | |
| This is advantageous over <em>set-tree</em> (below) because it produces | |
| cleaner, more linear history.<br /> | |
| </p> | |
| <div class="vlist"><dl> | |
| <dt> | |
| --no-rebase | |
| </dt> | |
| <dd> | |
| <p> | |
| After committing, do not rebase or reset. | |
| </p> | |
| </dd> | |
| <dt> | |
| --commit-url <URL> | |
| </dt> | |
| <dd> | |
| <p> | |
| Commit to this SVN URL (the full path). This is intended to | |
| allow existing git-svn 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="para"><p>config key: svn-remote.<name>.commiturl</p></div> | |
| <div class="para"><p>config key: svn.commiturl (overwrites all svn-remote.<name>.commiturl options)</p></div> | |
| <div class="literalblock"> | |
| <div class="content"> | |
| <pre><tt>Using this option for any other purpose (don't ask) | |
| is very strongly discouraged.</tt></pre> | |
| </div></div> | |
| </dd> | |
| </dl></div> | |
| </dd> | |
| </dl></div> | |
| <div class="vlist"><dl> | |
| <dt> | |
| <em>branch</em> | |
| </dt> | |
| <dd> | |
| <p> | |
| Create a branch in the SVN repository. | |
| </p> | |
| <div class="vlist"><dl> | |
| <dt> | |
| -m | |
| </dt> | |
| <dt> | |
| --message | |
| </dt> | |
| <dd> | |
| <p> | |
| Allows to specify the commit message. | |
| </p> | |
| </dd> | |
| <dt> | |
| -t | |
| </dt> | |
| <dt> | |
| --tag | |
| </dt> | |
| <dd> | |
| <p> | |
| Create a tag by using the tags_subdir instead of the branches_subdir | |
| specified during git svn init. | |
| </p> | |
| </dd> | |
| </dl></div> | |
| </dd> | |
| <dt> | |
| <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> | |
| <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="para"><p>The following features from `svn log' are supported:</p></div> | |
| <div class="vlist"><dl> | |
| <dt> | |
| --revision=<n>[:<n>] | |
| </dt> | |
| <dd> | |
| <p> | |
| is supported, non-numeric args are not: | |
| HEAD, NEXT, BASE, PREV, etc … | |
| </p> | |
| </dd> | |
| <dt> | |
| -v/--verbose | |
| </dt> | |
| <dd> | |
| <p> | |
| it's not completely compatible with the --verbose | |
| output in svn log, but reasonably close. | |
| </p> | |
| </dd> | |
| <dt> | |
| --limit=<n> | |
| </dt> | |
| <dd> | |
| <p> | |
| is NOT the same as --max-count, doesn't count | |
| merged/excluded commits | |
| </p> | |
| </dd> | |
| <dt> | |
| --incremental | |
| </dt> | |
| <dd> | |
| <p> | |
| supported | |
| </p> | |
| </dd> | |
| </dl></div> | |
| <div class="para"><p>New features:</p></div> | |
| <div class="vlist"><dl> | |
| <dt> | |
| --show-commit | |
| </dt> | |
| <dd> | |
| <p> | |
| shows the git commit sha1, as well | |
| </p> | |
| </dd> | |
| <dt> | |
| --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="para"><p>Any other arguments are passed directly to <em>git-log</em></p></div> | |
| </dd> | |
| <dt> | |
| <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 | |
| `svn blame' by default. Like the SVN blame command, | |
| local uncommitted changes in the working copy 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="vlist"><dl> | |
| <dt> | |
| --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't been committed to SVN (including local | |
| working-copy edits) are shown as revision 0. | |
| </p> | |
| </dd> | |
| </dl></div> | |
| </dd> | |
| </dl></div> | |
| <div class="vlist"><dl> | |
| <dt> | |
| <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> | |
| <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> | |
| <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> | |
| <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> | |
| <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<revision> option is required for this. | |
| </p> | |
| </dd> | |
| <dt> | |
| <em>info</em> | |
| </dt> | |
| <dd> | |
| <p> | |
| Shows information about a file or directory similar to what | |
| `svn info' 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> | |
| <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> | |
| <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> | |
| <em>show-externals</em> | |
| </dt> | |
| <dd> | |
| <p> | |
| Shows the Subversion externals. Use -r/--revision to specify a | |
| specific revision. | |
| </p> | |
| </dd> | |
| </dl></div> | |
| </div> | |
| <h2 id="_options">OPTIONS</h2> | |
| <div class="sectionbody"> | |
| <div class="vlist"><dl> | |
| <dt> | |
| --shared[={false|true|umask|group|all|world|everybody}] | |
| </dt> | |
| <dt> | |
| --template=<template_directory> | |
| </dt> | |
| <dd> | |
| <p> | |
| Only used with the <em>init</em> command. | |
| These are passed directly to <em>git-init</em>. | |
| </p> | |
| </dd> | |
| <dt> | |
| -r <ARG> | |
| </dt> | |
| <dt> | |
| --revision <ARG> | |
| </dt> | |
| <dd> | |
| <p> | |
| Used with the <em>fetch</em> command. | |
| </p> | |
| <div class="para"><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="para"><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> | |
| - | |
| </dt> | |
| <dt> | |
| --stdin | |
| </dt> | |
| <dd> | |
| <p> | |
| Only used with the <em>set-tree</em> command. | |
| </p> | |
| <div class="para"><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> | |
| --rmdir | |
| </dt> | |
| <dd> | |
| <p> | |
| Only used with the <em>dcommit</em>, <em>set-tree</em> and <em>commit-diff</em> commands. | |
| </p> | |
| <div class="para"><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="para"><p>config key: svn.rmdir</p></div> | |
| </dd> | |
| <dt> | |
| -e | |
| </dt> | |
| <dt> | |
| --edit | |
| </dt> | |
| <dd> | |
| <p> | |
| Only used with the <em>dcommit</em>, <em>set-tree</em> and <em>commit-diff</em> commands. | |
| </p> | |
| <div class="para"><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="para"><p>config key: svn.edit</p></div> | |
| </dd> | |
| <dt> | |
| -l<num> | |
| </dt> | |
| <dt> | |
| --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="para"><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="content">config key: svn.l | |
| config key: svn.findcopiesharder</div></div> | |
| </dd> | |
| <dt> | |
| -A<filename> | |
| </dt> | |
| <dt> | |
| --authors-file=<filename> | |
| </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 <user@example.com></tt></pre> | |
| </div></div> | |
| <div class="para"><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="para"><p>config key: svn.authorsfile</p></div> | |
| </dd> | |
| <dt> | |
| -q | |
| </dt> | |
| <dt> | |
| --quiet | |
| </dt> | |
| <dd> | |
| <p> | |
| Make <em>git-svn</em> less verbose. Specify a second time to make it | |
| even less verbose. | |
| </p> | |
| </dd> | |
| <dt> | |
| --repack[=<n>] | |
| </dt> | |
| <dt> | |
| --repack-flags=<flags> | |
| </dt> | |
| <dd> | |
| <p> | |
| These should help keep disk usage sane for large fetches | |
| with many revisions. | |
| </p> | |
| <div class="para"><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="para"><p>--repack-flags are passed directly to <em>git-repack</em>.</p></div> | |
| <div class="verseblock"> | |
| <div class="content">config key: svn.repack | |
| config key: svn.repackflags</div></div> | |
| </dd> | |
| <dt> | |
| -m | |
| </dt> | |
| <dt> | |
| --merge | |
| </dt> | |
| <dt> | |
| -s<strategy> | |
| </dt> | |
| <dt> | |
| --strategy=<strategy> | |
| </dt> | |
| <dd> | |
| <p> | |
| These are only used with the <em>dcommit</em> and <em>rebase</em> commands. | |
| </p> | |
| <div class="para"><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> | |
| -n | |
| </dt> | |
| <dt> | |
| --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="para"><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="para"><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="para"><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> | |
| </dl></div> | |
| </div> | |
| <h2 id="_advanced_options">ADVANCED OPTIONS</h2> | |
| <div class="sectionbody"> | |
| <div class="vlist"><dl> | |
| <dt> | |
| -i<GIT_SVN_ID> | |
| </dt> | |
| <dt> | |
| --id <GIT_SVN_ID> | |
| </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> | |
| -R<remote name> | |
| </dt> | |
| <dt> | |
| --svn-remote <remote name> | |
| </dt> | |
| <dd> | |
| <p> | |
| Specify the [svn-remote "<remote name>"] section to use, | |
| this allows SVN multiple repositories to be tracked. | |
| Default: "svn" | |
| </p> | |
| </dd> | |
| <dt> | |
| --follow-parent | |
| </dt> | |
| <dd> | |
| <p> | |
| This is especially helpful when we'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="para"><p>config key: svn.followparent</p></div> | |
| </dd> | |
| </dl></div> | |
| </div> | |
| <h2 id="_config_file_only_options">CONFIG FILE-ONLY OPTIONS</h2> | |
| <div class="sectionbody"> | |
| <div class="vlist"><dl> | |
| <dt> | |
| svn.noMetadata | |
| </dt> | |
| <dt> | |
| svn-remote.<name>.noMetadata | |
| </dt> | |
| <dd> | |
| <p> | |
| This gets rid of the <em>git-svn-id:</em> lines at the end of every commit. | |
| </p> | |
| <div class="para"><p>If you lose your .git/svn/git-svn/.rev_db file, <em>git-svn</em> will not | |
| be able to rebuild it and you won't be able to fetch again, | |
| either. This is fine for one-shot imports.</p></div> | |
| <div class="para"><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> | |
| </dd> | |
| <dt> | |
| svn.useSvmProps | |
| </dt> | |
| <dt> | |
| svn-remote.<name>.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="para"><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> | |
| svn.useSvnsyncProps | |
| </dt> | |
| <dt> | |
| svn-remote.<name>.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> | |
| svn-remote.<name>.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> | |
| 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 "git-svn" is running and take effect on | |
| the next revision fetched. If unset, git-svn assumes this option to be | |
| "true". | |
| </p> | |
| </dd> | |
| </dl></div> | |
| <div class="para"><p>Since the noMetadata, rewriteRoot, 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="para"><p>Additionally, only one of these four options can be used per-svn-remote | |
| section because they affect the <em>git-svn-id:</em> metadata line.</p></div> | |
| </div> | |
| <h2 id="_basic_examples">BASIC EXAMPLES</h2> | |
| <div class="sectionbody"> | |
| <div class="para"><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 >> .git/info/exclude</tt></pre> | |
| </div></div> | |
| <div class="para"><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="para"><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 && 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 --add remote.origin.fetch '+refs/remotes/*:refs/remotes/*' | |
| git fetch | |
| # 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="para"><p>Originally, <em>git-svn</em> recommended that the <em>remotes/git-svn</em> branch be | |
| pulled or merged from. This is 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.</p></div> | |
| <div class="para"><p>If you use <tt>git svn set-tree A..B</tt> to commit several diffs and you do | |
| not have the latest remotes/git-svn merged into my-branch, you should | |
| use <tt>git svn rebase</tt> to update your work branch instead of <tt>git pull</tt> or | |
| <tt>git merge</tt>. <tt>pull</tt>/`merge' can cause non-linear history to be flattened | |
| when committing into SVN, which can lead to merge commits reversing | |
| previous commits in SVN.</p></div> | |
| </div> | |
| <h2 id="_design_philosophy">DESIGN PHILOSOPHY</h2> | |
| <div class="sectionbody"> | |
| <div class="para"><p>Merge tracking in Subversion is lacking and doing branched development | |
| with Subversion can be cumbersome as a result. 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="para"><p>For the sake of simplicity and interoperating with a less-capable system | |
| (SVN), 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'ing to the SVN repository.</p></div> | |
| <div class="para"><p>Running <em>git-merge</em> or <em>git-pull</em> is NOT recommended on a branch you | |
| plan to <em>dcommit</em> from. Subversion does not represent merges in any | |
| reasonable or useful fashion; so users using Subversion cannot see any | |
| merges you'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="para"><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="para"><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="para"><p>Do not use the --amend option of <a href="git-commit.html">git-commit(1)</a> on a change you've | |
| already dcommitted. It is considered bad practice to --amend commits | |
| you've already pushed to a remote repository for other users, and | |
| dcommit with SVN is analogous to that.</p></div> | |
| </div> | |
| <h2 id="_bugs">BUGS</h2> | |
| <div class="sectionbody"> | |
| <div class="para"><p>We ignore all SVN properties except svn:executable. Any unhandled | |
| properties are logged to $GIT_DIR/svn/<refname>/unhandled.log</p></div> | |
| <div class="para"><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's quite difficult and time-consuming to get working for all | |
| the possible corner cases (git doesn't do it, either). Committing | |
| renamed and copied files are fully supported if they're similar enough | |
| for git to detect them.</p></div> | |
| </div> | |
| <h2 id="_configuration">CONFIGURATION</h2> | |
| <div class="sectionbody"> | |
| <div class="para"><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="para"><p>Keep in mind that the <em>*</em> (asterisk) wildcard of the local ref | |
| (right of the <em>:</em>) *must* be the farthest right path component; | |
| however the remote wildcard may be anywhere as long as it'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> | |
| <h2 id="_see_also">SEE ALSO</h2> | |
| <div class="sectionbody"> | |
| <div class="para"><p><a href="git-rebase.html">git-rebase(1)</a></p></div> | |
| </div> | |
| <h2 id="_author">Author</h2> | |
| <div class="sectionbody"> | |
| <div class="para"><p>Written by Eric Wong <normalperson@yhbt.net>.</p></div> | |
| </div> | |
| <h2 id="_documentation">Documentation</h2> | |
| <div class="sectionbody"> | |
| <div class="para"><p>Written by Eric Wong <normalperson@yhbt.net>.</p></div> | |
| </div> | |
| <div id="footer"> | |
| <div id="footer-text"> | |
| Last updated 2009-04-23 03:06:42 UTC | |
| </div> | |
| </div> | |
| </body> | |
| </html> |