Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git svn clone not checking out all directories

Tags:

git

svn

git-svn

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.

like image 608
Ethan Avatar asked Dec 14 '22 03:12

Ethan


2 Answers

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?

like image 150
Mark van Lent Avatar answered Dec 18 '22 00:12

Mark van Lent


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

like image 31
VonC Avatar answered Dec 17 '22 23:12

VonC