8

How to use git svn clone to only get the HEAD revision from a Subversion repository?

I been trying

git svn clone -s http://svn/java/<projectname>

but I been getting a lot of empty directory and I tried everything. So know I would like to do a clone of just the head in subversion... Can this be done?

2 Answers 2

15

I think this is what you want:

git svn clone -s -r HEAD http://svn/java/<projectname>

You can also specify a range with -r 2039:HEAD if, for example, you want all the revisions from 2039 up to the latest. You might do this if it's really the history prior to 2039 that you object to, rather than everything prior to the current revision.

1
  • 1
    i had to remove the "-s" and add change the url to htp://svn/java/<project>/trunk but it looks like it worked for my issues Feb 14, 2013 at 20:37
11
git svn clone -r HEAD http://svn/java/<projectname>

Don't forget "-r HEAD". It fetches to the latest revision.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.