git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Add SVN->Git conversion example to documentation
@ 2008-06-14 18:03 Heikki Orsila
  2008-06-15 13:17 ` Karl Hasselström
  0 siblings, 1 reply; 9+ messages in thread
From: Heikki Orsila @ 2008-06-14 18:03 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

Signed-off-by: Heikki Orsila <heikki.orsila@iki.fi>
---
 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..128761e 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 to
+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

^ permalink raw reply related	[flat|nested] 9+ messages in thread
* [PATCH] Add SVN->Git conversion example to documentation
@ 2008-06-14 18:09 Heikki Orsila
  2008-06-14 19:06 ` Miklos Vajna
  0 siblings, 1 reply; 9+ messages in thread
From: Heikki Orsila @ 2008-06-14 18:09 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

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

^ permalink raw reply related	[flat|nested] 9+ messages in thread
* [PATCH] Add SVN->Git conversion example to documentation
@ 2008-06-14 21:58 Heikki Orsila
  2008-06-14 22:47 ` Miklos Vajna
  2008-06-17 23:21 ` Junio C Hamano
  0 siblings, 2 replies; 9+ messages in thread
From: Heikki Orsila @ 2008-06-14 21:58 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Miklos Vajna

Signed-off-by: Heikki Orsila <heikki.orsila@iki.fi>
---
This is the third round. Added some commands to clean up the repository, 
and set fetch heads. Thanks to Miklos Vajna for feedback.

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

diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
index f4cbd2f..26e00c5 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,38 @@ 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
+------------------------------------------------------------------------
+After that, the new repository should be cleaned, and fetch heads should
+be set.
+------------------------------------------------------------------------
+	cd foo.git/.git
+	rm -rf svn
+	git config --remove-section svn-remote.svn
+	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
+	git gc
+------------------------------------------------------------------------
+
 REBASE VS. PULL/MERGE
 ---------------------
 
-- 
1.5.5.1.1.ga5e5c

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-06-18  0:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-14 18:03 [PATCH] Add SVN->Git conversion example to documentation Heikki Orsila
2008-06-15 13:17 ` Karl Hasselström
  -- strict thread matches above, loose matches on Subject: below --
2008-06-14 18:09 Heikki Orsila
2008-06-14 19:06 ` Miklos Vajna
2008-06-14 21:50   ` Heikki Orsila
2008-06-14 21:58 Heikki Orsila
2008-06-14 22:47 ` Miklos Vajna
2008-06-17 23:21 ` Junio C Hamano
2008-06-18  0:55   ` Heikki Orsila

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).