Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git svn clone results in empty directory

Tags:

git

svn

I have an svn repository with project structure:

/root/projectA/trunk /root/projectA/branches /root/projectA/tags  /root/projectB/trunk /root/projectB/branches /root/projectB/tags  

I want to clone projectA. When I run:

git svn clone -r <revision number>:HEAD <url>/root/projectA 

I get no errors and a git repository is created under the new projectA directory. However the directory is empty. Am I missing soemthing?

like image 800
tom eustace Avatar asked Aug 15 '12 08:08

tom eustace


People also ask

How do I clone a SVN repository?

# Clone a repo with standard SVN directory layout (like git clone): git svn clone http://svn.example.com/project --stdlayout --prefix svn/ # Or, if the repo uses a non-standard directory layout: git svn clone http://svn.example.com/project -T tr -b branch -t tag --prefix svn/ # View all branches and tags you have ...

What does git SVN clone do?

The git svn clone command transforms the trunk, branches, and tags in your SVN repository into a new Git repository. Depending on the structure of your SVN repo, the command needs to be configured differently.

Does git track empty directory?

To get Git to recognize an empty directory, the unwritten rule is to put a file named . gitkeep in it. Git will see the . gitkeep file in the otherwise empty folder and make that folder part of the next commit or push.


1 Answers

My problem was using the -s or --stdlayout because my svn repo did NOT have a standard layout (trunk, branches, tags).

like image 181
wspeirs Avatar answered Sep 26 '22 03:09

wspeirs