Cloning a subversion project from google code using git

user266003 picture user266003 · Oct 20, 2013 · Viewed 31.3k times · Source

There is someone's project at google code which I want to clone using git. However, nothing of these worked:

git clone http://some_app.googlecode.com

git clone http://some_app.googlecode.com/svn

git clone http://some_app.googlecode.com/svn/trunk

git svn -s clone http://some_app.googlecode.com/svn/trunk

How do I do it?

Answer

Paul Wagland picture Paul Wagland · Oct 20, 2013

Since, based on the URL, it looks like you are trying to access a subversion repository, you cannot use git in a simple way to get to it.

Theoretically you could use git-svn, which you looked at in your last example, however if you don't know about it already you probably want to learn more about git and svn first.

To check the code out of an svn repository you need to use svn, as in:

svn co http://some_app.googlecode.com/svn/trunk

If you really want to use git to access the subversion repository via git, then you need to init the repository first. The workflow looks something like:

git svn clone -s http://some_app.googlecode.com/svn/

The -s switch says to use the standard layout, and so will append trunk to it.