tags:

views:

539

answers:

3

I have a project in SVN and I tried to clone it with git-svn. I followed the example in the git-svn docs.

git svn clone  svn+ssh://host/path/trunk  project_name

The command completed with no error msg, but the cloned project does not contain all the directories as the project in SVN.

At the top level, my SVN project has...

$ svn ls  svn+ssh://host/path/trunk
README
Rakefile
app/
config/
db/
doc/
lib/
log/
public/
script/
test/
tmp/
vendor/

After cloning, locally I have...

README
Rakefile
app
config
doc
public
script
test

There are also subdirs missing.


UPDATE

Experimentally cloned another project on same host. Seemed to work fine. What's special about this one? Nothing I can think of except that I just created it and imported it into SVN before cloning. Would that make a difference?


Tried creating a completely new project, importing to SVN and cloning. Got same result, same missing dirs.

+1  A: 

Are you sure your SVN is not using some svn:external (see comments)?
More details on that process in the article "moving from svn to git"

svn-git really ought to warn you somehow that it doesn’t support fetching externals.
This I learned by noticing that the svn log had no checkins of those files and then saw when I did a clean svn checkout that it was fetching externals for the vendor/plugins directory.

So, I decided to just pull in the vendor/plugins directory verbatim, detaching the external reference, and move to git submodules as we upgrade.
What I really wanted to do, but didn’t see how to, was to reference the plugin code as an http URL and keep as a submodule, so that I would have a handy reference to source location and revision

VonC
Thanks. I'm 100% sure that's not happening here. I'll check out the link.
Ethan
@Ethan: all right, I leave the post for information. You can post your own answer if you find the root cause, and select it as the official one.
VonC
Thanks for the help. I think I need to do some reading and gain a better general understanding of how git works.
Ethan
+1  A: 

You could try

svn2git

or

git svn clone  svn+ssh://host/path project_name --trunk=trunk/*

There is some form of deep cloning in git 1.6+, but I'm not sure if this is the right syntax

jitter
Thanks. I checked out svn2git on Github. I'll try it when I can.
Ethan
+6  A: 

As far as I can tell, git doesn't tracks empty directories:

http://git.or.cz/gitwiki/GitFaq#CanIaddemptydirectories.3F:

That is, directories never have to be added to the repository, and are not tracked on their own.

Does this make sense? Are the missing directories empty?

Mark van Lent
Yes, it was the empty directories that were not pulled in from SVN. Thanks.
Ethan
Good catch. +1 .
VonC
I had a similar problem. According to the link, Git doesn't actually track directories. It tracks files. So, no files in a directory means Git doesn't know about it.