{"thread":{"id":"14060","subject":"[PATCH] Add SVN->Git conversion example to documentation, and cleanup the doc","startedAt":"2008-06-20T13:23:48Z","lastAt":"2008-06-20T13:23:48Z","messageCount":1,"participants":["Heikki Orsila"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"80483","messageId":"20080620132348.GA21193@zakalwe.fi","threadId":"14060","inReplyTo":null,"subject":"[PATCH] Add SVN->Git conversion example to documentation, and cleanup the doc","fromName":"Heikki Orsila","fromEmail":"heikki.orsila@iki.fi","sentAt":"2008-06-20T13:23:48Z","receivedAt":"2008-06-20T13:23:48Z","isPatch":true,"sender":{"key":"heikki.orsila@iki.fi","avatar":null},"body":"Signed-off-by: Heikki Orsila <heikki.orsila@iki.fi>\n---\nThis is the fourth round of the patch. Changes to earlier attempts:\n\n* Explain git<>svn process better (Junio C Hamano)\n\n* Don't mention git-svnimport unnecessarily. And where mentioned, \n  mark it as deprecated. (Karl Hasselström, Junio C Hamano)\n\n* Remove unnecessary words from description\n\n* Rename foo.git -> foo (Miklos Vajna)\n\n* Remove refs/remotes/git-svn (Miklos Vajna)\n\n* Don't set unnecessary fetch sources\n\n* Use proper syntax for marking command line options in the text.\n  Use \"`--no-metadata`\" instead of \"--no-metadata\". (Junio C Hamano)\n\n* Improve explanation of \"`--no-metadata`\"\n\n* This patch explains how to do one step transition to Git repository.\n  Further updates from the SVN repo are not possible. A later patch may\n  explain the process of incremental updates, but it doesn't really\n  address the issue of moving from SVN to Git as Git should be\n  self-sufficient. (Miklos Vajna)\n\n Documentation/git-svn.txt |   56 +++++++++++++++++++++++++++++++++++++--------\n 1 files changed, 46 insertions(+), 10 deletions(-)\n\ndiff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt\nindex 97bed54..551f1df 100644\n--- a/Documentation/git-svn.txt\n+++ b/Documentation/git-svn.txt\n@@ -11,15 +11,15 @@ SYNOPSIS\n \n DESCRIPTION\n -----------\n-git-svn is a simple conduit for changesets between Subversion and git.\n-It is not to be confused with linkgit:git-svnimport[1], which is\n-read-only.\n+git-svn is a simple bidirectional conduit for changesets between\n+Subversion and git. It is used to develop SVN hosted projects with Git tools.\n+Changes are committed to a Git repository as would be normally done with\n+Git, but the tool converts these commits later to SVN commits.\n+It can also be used to convert a Subversion repository to a Git repository.\n \n-git-svn was originally designed for an individual developer who wants a\n-bidirectional flow of changesets between a single branch in Subversion\n-and an arbitrary number of branches in git.  Since its inception,\n-git-svn has gained the ability to track multiple branches in a manner\n-similar to git-svnimport.\n+git-svn was designed for developers who want\n+bidirectional flow of changesets between multiple branches in Subversion\n+and an arbitrary number of branches in git. \n \n git-svn is especially useful when it comes to tracking repositories\n not organized in the way Subversion developers recommend (trunk,\n@@ -219,7 +219,7 @@ Any other arguments are passed directly to `git log'\n 'commit-diff'::\n \tCommits the diff of two tree-ish arguments from the\n \tcommand-line.  This command is intended for interoperability with\n-\tgit-svnimport and does not rely on being inside an git-svn\n+\tgit-svnimport (deprecated) and does not rely on being inside an git-svn\n \tinit-ed repository.  This command takes three arguments, (a) the\n \toriginal tree to diff against, (b) the new tree result, (c) the\n \tURL of the target Subversion repository.  The final argument\n@@ -317,7 +317,7 @@ config key: svn.findcopiesharder\n -A<filename>::\n --authors-file=<filename>::\n \n-Syntax is compatible with the files used by git-svnimport and\n+Syntax is compatible with the files used by git-svnimport (deprecated) and\n git-cvsimport:\n \n ------------------------------------------------------------------------\n@@ -521,6 +521,42 @@ have each person clone that repository with 'git clone':\n \tgit-svn rebase\n ------------------------------------------------------------------------\n \n+CONVERTING A SUBVERSION REPOSITORY TO A GIT REPOSITORY\n+------------------------------------------------------\n+\n+When converting a Subversion repository to a Git repository\n+\"`--no-metadata`\" prevents git-svn from adding \"git-svn-id:\" comments to\n+the log. \"`-A`\" option is used to convert SVN pseudonyms to real names\n+and email addresses. The whole repository, or a part of it can be\n+converted. Two examples below show how to convert the whole repo\n+with all branches, or only the SVN trunk. Note, this way it is\n+impossible to update Git repository incrementally from the SVN repository.\n+This is a one-step, one-way conversion.\n+\n+------------------------------------------------------------------------\n+# Convert all branches of an SVN repository to a Git repository:\n+\n+\tgit svn clone --no-metadata -A authors.txt SVN_URL foo\n+\n+# Convert only the trunk of an SVN repository to a Git repository:\n+\n+\tgit svn clone --no-metadata -A authors.txt SVN_URL/trunk foo\n+------------------------------------------------------------------------\n+Next, the new repository should be verified to match what was\n+expected. Go through the repository and logs to do that.\n+Also, there may have been typos in the author file. It is crucial to\n+get authors correctly in the conversion step, because it is very\n+awkward and inconvenient to do it later (with rewrite).\n+The last step is to remove the svn data from the repository,\n+and repack the repository.\n+------------------------------------------------------------------------\n+\tcd foo/.git\n+\trm -rf svn\n+\trm -f refs/remotes/git-svn\n+\tgit config --remove-section svn-remote.svn\n+\tgit gc\n+------------------------------------------------------------------------\n+\n REBASE VS. PULL/MERGE\n ---------------------\n \n-- \n1.5.5.1.1.ga5e5c\n"}]}