2

I've a pretty big Git repository. It's cloned from SVN via git-svn so there are many branches/, tags/ and trunk/ directories and thus a lot of duplicated files. I guess Git handles these files efficiently internally (magic under .git/ directory). However working directory is full of (SVN) garbage.

Is it possible to checkout only part of reposiotry into working directory? How can I do it?

Thank you.

EDIT: The answer is "sparse checkout" feature of Git 1.7.0.

Zoe
  • 23,712
  • 16
  • 99
  • 132
woky
  • 4,232
  • 9
  • 32
  • 41
  • 1
    Duplicate of http://stackoverflow.com/questions/600079/is-there-any-way-to-clone-a-git-repositorys-sub-directory-only – v01d Oct 20 '11 at 07:25
  • Not true. I want clone _whole_ repository. I want to checkout only a part of it into working directory. – woky Oct 20 '11 at 07:34
  • So you don't have a clone, you have a git repo tracking a local copy of an SVN repo. No? See the answer from @Andrew – ANeves thinks SE is evil Oct 20 '11 at 07:42
  • I take it back. The answer is here [link](http://stackoverflow.com/questions/600079/is-there-any-way-to-clone-a-git-repositorys-sub-directory-only/2861204#2861204). – woky Oct 20 '11 at 07:43

1 Answers1

0

If you've got many branches and tags directories it sounds like you've done something wrong. When you import into Git you should have one repository with Git style branches and tags.

Github have a page about importing into Git from Subversion. They recommend using svn2git. I've used sv2git with success.

Andrew
  • 6,396
  • 3
  • 25
  • 38
  • The problem is that we have many "sub-repositories" in our SVN repository (which contains `branches/`, ...). These directories are nothing special in fact. – woky Oct 20 '11 at 07:42
  • By the way you don't need svn2git anymore because git-svn now handles SVN tags and branches too. – woky Oct 20 '11 at 07:57