Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git - how can I clone local svn repository?

Tags:

git

clone

git-svn

I am completely unable to find any explanation how I should specify location of existing svn repository.

In other words - what should be used as URL in

git svn clone URL 

when svn repository is local?

like image 523
Bulwersator Avatar asked Mar 12 '13 23:03

Bulwersator


People also ask

How do I clone a local repository in SVN?

# 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 ...

How do I access local SVN repository?

You can either store your repositories locally and access them using the file:// protocol or you can place them on a server and access them with the http:// or svn:// protocols. The two server protocols can also be encrypted. You use https:// or svn+ssh:// , or you can use svn:// with SASL.

Does SVN have a local repository?

This page describes how to set up a local Subversion (SVN) repository using TortoiseSVN, a free Subversion client for Windows. It's difficult to share changes and keep backups with a local repository, so we don't recommend it as a long-term solution.


2 Answers

You should be able to succeed like this:

git svn clone file:///e/svn_repo_on_E_drive 

Similar to svn checkout command:

svn co file:///e/svn_repo_on_E_drive 

file:// for folder on the current drive of the executing CMD prompt, file:///d/some_folder for D:\some_folder.

Note: The extra / and the removed colon : in the file link on Windows. file://e:/svn_repo_on_E_drivefile:///e/svn_repo_on_E_drive

like image 124
zionyx Avatar answered Sep 21 '22 15:09

zionyx


For a local repository you use a file:// URL, same as would be used for doing a checkout with the normal svn client.

If you're trying to copy the entire history, and using git svn clone --stdlayout just use the URL that you would use to checkout the trunk with svn minus the /trunk portion at the end.

like image 38
qqx Avatar answered Sep 18 '22 15:09

qqx