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?
# 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 ...
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.
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.
My problem was using the -s
or --stdlayout
because my svn repo did NOT have a standard layout (trunk, branches, tags).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With