git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Miklos Vajna <vmiklos@frugalware.org>
Date
Jun 14, 2008, 22:47 UTC
Message-ID
<20080614224758.GL29404@genesis.frugalware.org>
In-Reply-To
<20080614215812.GA28574@zakalwe.fi>
On Sun, Jun 15, 2008 at 12:58:12AM +0300, Heikki Orsila <heikki.orsila@iki.fi> wrote:
> +After that, the new repository should be cleaned, and fetch heads should
> +be set.
> +------------------------------------------------------------------------
> +	cd foo.git/.git

Heh, I was confused. foo.git is usually a bare repo, if the repo has a working directory as well, then just call it foo.

And then: if you convert an svn repo to a git one, don't you want to convert it to a bare repo?

I haven't tried git-svn clone but the following will work for sure:

git --bare init git --bare svn init -s URL git --bare svn fetch

Show 7 quoted lines
> +	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

If you remove the svn dir, why don't you remove refs/remotes as well? (Probably via update-ref since git svn will pack refs before it ends for big repos, I think.)

Also I think it would be a good idea to give a hint how to do incremental updates. Something like not deleting the svn dir and using git --bare svn fetch; git fetch.

PS: I'm not a git-svn contributor or anything, just thought I give you
some advices, I hope it helped. :-)
Previous: Heikki OrsilaNext: Junio C Hamano
Message 2 of 4 in “Add SVN->Git conversion example to documentation”
  1. Add SVN->Git conversion example to documentationHeikki Orsila, Jun 14, 2008
  2. Miklos VajnaJun 14, 2008
  3. Junio C HamanoJun 17, 2008
  4. Heikki OrsilaJun 18, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.