When cloning an svn repository into git, should I clone only trunk, or the entire repo?
What is the best practice here?
The repository in question is here: http://svn.osq开发者_运维技巧a.net/svnroot/osqa/
I'd clone everything in the first place, just in case you need the other branches later, with:
git svn clone --stdlayout http://svn.osqa.net/svnroot/osqa/
In this case I can't see any particular reason not to, since even with all the branches a git svn clone
of the repository only ends up being 11 megabytes. It'll make things easier later if you are interested in the other branches.
The problem is that subversion branches are exposed (usually, and in your case) via a standard naming convention of TOPLEVEL/branches/...
. The way git
does it is not so explicit - that is, if you do a git checkout BRANCH_NAME
, the branch files are "swapped in" to your current working directory.
With this in mind, I'd suggest only importing trunk, and then importing all the directories in the TOPLEVEL/branches/branchname
directory as git branches as you need them.
精彩评论