# [PATCH] Add SVN->Git conversion example to documentation

3 messages from 2008-06-14 to 2008-06-14. Participants: Heikki Orsila, Miklos Vajna.
Thread: https://gitlist.dev/t/13956

## Heikki Orsila, 2008-06-14 18:09

Subject: [PATCH] Add SVN->Git conversion example to documentation
Message-ID: <20080614180929.GA26449@zakalwe.fi>
URL: https://gitlist.dev/e/20080614180929.GA26449%40zakalwe.fi

```
Signed-off-by: Heikki Orsila <heikki.orsila@iki.fi>
---
This is a correction to the earlier patch that had a typo.

 Documentation/git-svn.txt |   29 ++++++++++++++++++++++++++---
 1 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
index f4cbd2f..dcf1e25 100644
--- a/Documentation/git-svn.txt
+++ b/Documentation/git-svn.txt
@@ -11,9 +11,12 @@ SYNOPSIS
 
 DESCRIPTION
 -----------
-git-svn is a simple conduit for changesets between Subversion and git.
-It is not to be confused with linkgit:git-svnimport[1], which is
-read-only.
+git-svn is a simple bidirectional conduit for changesets between
+Subversion and git. It is used to develop projects with Git tools,
+but commit changes to a Subversion repository. It can also be used to
+convert a Subversion repository to a Git repository. It should not
+be confused with linkgit:git-svnimport[1], which does Subversion to
+Git conversion, but not the other direction.
 
 git-svn was originally designed for an individual developer who wants a
 bidirectional flow of changesets between a single branch in Subversion
@@ -520,6 +523,26 @@ have each person clone that repository with 'git clone':
 	git-svn rebase
 ------------------------------------------------------------------------
 
+CONVERTING A SUBVERSION REPOSITORY TO A GIT REPOSITORY
+------------------------------------------------------
+
+When converting a Subversion repository to a Git repository
+--no-metadata removes "git-svn-id:" comments from the log.
+-A option is used to convert SVN pseudonyms to real names
+and email addresses. The whole repository, or a part of it can be
+converted. Two examples below show how to convert the whole repo
+with all branches, or only the SVN trunk.
+
+------------------------------------------------------------------------
+# Convert all branches of an SVN repository to a Git repository:
+
+	git svn clone --no-metadata -A authors.txt SVN_URL foo.git
+
+# Convert only the trunk of an SVN repository to a Git repository:
+
+	git svn clone --no-metadata -A authors.txt SVN_URL/trunk foo.git
+------------------------------------------------------------------------
+
 REBASE VS. PULL/MERGE
 ---------------------
 
-- 
1.5.5.1.1.ga5e5c

```

## Miklos Vajna, 2008-06-14 19:06

Subject: Re: [PATCH] Add SVN->Git conversion example to documentation
Message-ID: <20080614190648.GF29404@genesis.frugalware.org>
URL: https://gitlist.dev/e/20080614190648.GF29404%40genesis.frugalware.org
In-Reply-To: <20080614180929.GA26449@zakalwe.fi>

```
On Sat, Jun 14, 2008 at 09:09:29PM +0300, Heikki Orsila <heikki.orsila@iki.fi> wrote:
> +------------------------------------------------------------------------
> +# Convert all branches of an SVN repository to a Git repository:
> +
> +	git svn clone --no-metadata -A authors.txt SVN_URL foo.git

Don't you need -s here?

Two other minor notes:

1) I would add an example on how to update such a repo in case it will
be a mirror, like 'git --bare svn fetch'.

2) I would mention that one still needs a trick if he/she wants to allow
others to clone this repo, with something like:

git config remote.origin.url .
git config remote.origin.fetch +refs/remotes/tags/*:refs/tags/*
git config --add remote.origin.fetch +refs/remotes/*:refs/heads/*
git fetch

```

## Heikki Orsila, 2008-06-14 21:50

Subject: Re: [PATCH] Add SVN->Git conversion example to documentation
Message-ID: <20080614215048.GO10527@jolt.modeemi.cs.tut.fi>
URL: https://gitlist.dev/e/20080614215048.GO10527%40jolt.modeemi.cs.tut.fi
In-Reply-To: <20080614190648.GF29404@genesis.frugalware.org>

```
On Sat, Jun 14, 2008 at 09:06:48PM +0200, Miklos Vajna wrote:
> On Sat, Jun 14, 2008 at 09:09:29PM +0300, Heikki Orsila <heikki.orsila@iki.fi> wrote:
> > +------------------------------------------------------------------------
> > +# Convert all branches of an SVN repository to a Git repository:
> > +
> > +	git svn clone --no-metadata -A authors.txt SVN_URL foo.git
> 
> Don't you need -s here?

It seems not.

> 2) I would mention that one still needs a trick if he/she wants to allow
> others to clone this repo, with something like:
> 
> git config remote.origin.url .
> git config remote.origin.fetch +refs/remotes/tags/*:refs/tags/*
> git config --add remote.origin.fetch +refs/remotes/*:refs/heads/*
> git fetch

Will add.

-- 
Heikki Orsila
heikki.orsila@iki.fi
http://www.iki.fi/shd

```
