Talk:Git FAQ
From Git SCM Wiki
(Redirected from Talk:GitFaq)
"How do I mirror a SVN repository to git?" unnecessarily complicated
Couldn't we simply do this instead? Or am I missing something?
git svn clone -s svn://.../project git clone --mirror project
To update the mirror do
cd project git svn fetch cd ../project.git git fetch
To clone the mirror repository use
git clone path/to/project.git
To enable usage of git svn
in the clone use
git svn init -s --prefix=origin/ svn://.../project
--Drizzd 09:39, 15 March 2010 (UTC)
I've tested this, and it appears to work so far. --Ricky Clarkson 13:09, 15 March 2010 (UTC)
- Ok, but my proposal is flawed, because it will only mirror trunk. The current version mirrors all branches. It will not create a master branch, however, if such a branch does not exist in subversion. Since the master branch in subversion is usually called trunk, I have added the line git symbolic-ref HEAD refs/heads/trunk to the initialization for the bare repository. This should do the right thing for most cases. --Drizzd 11:16, 16 March 2010 (UTC)