Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does SVN have an equivalent for "hg clone" in Mercurial or "git clone" in Git?

Tags:

svn

mercurial

I have a URL for a Subversion repository and on the command line on Ubuntu I want to just download a copy of the repository as you would do in Mercurial by typing:

hg clone http://svn.somerepository.com/somerepository/trunk/docs/
  1. How do you "clone" a repository in SVN?

  2. Also, I just want to get everything below the docs folder - I don't want to start in the trunk - how would you do something like this:

    svn clone http://svn.somerepository.com/somerepository/trunk/docs/

like image 726
Egg Yolk Avatar asked Feb 16 '10 19:02

Egg Yolk


2 Answers

You want to perform what in SVN-land is called a "check out."

svn co http://svn.somerepository.com/somerepository/trunk/docs/

Note the main difference between SVN and distributed systems like Mercurial or Git is that SVN's "check out" command downloads only a copy of the most recent version of each file, whereas with hg clone you will actually end up with a local copy of the repository's entire history as well. This has some implications for the way in which you work. For example, you need to have a network connection to the server in order to retrieve logs, perform diffs, etc.

like image 145
Nick Meyer Avatar answered Oct 12 '22 15:10

Nick Meyer


If you just need to grab the current version, svn checkout is all you need.

If you want a complete copy of the repository, including all previous versions, you can use svnsync. It can copy a complete repository and incrementally download new commits. I don't think it can be restricted to subdirectories though.

like image 6
Wim Avatar answered Oct 12 '22 17:10

Wim