简体   繁体   English

SVN在Mercurial中是否具有“hg clone”或Git中的“git clone”?

[英]Does SVN have an equivalent for “hg clone” in Mercurial or “git clone” in Git?

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: 我有一个Subversion存储库的URL,在Ubuntu的命令行上我只想下载一个存储库的副本,就像在Mercurial中输入一样:

hg clone http://svn.somerepository.com/somerepository/trunk/docs/
  1. How do you "clone" a repository in SVN? 你如何“克隆”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: 另外, 我只是想把所有内容都放在docs文件夹下面 - 我不想从主干开始 - 你会怎么做这样的事情:

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

You want to perform what in SVN-land is called a "check out." 你想在SVN-land中执行什么称为“结账”。

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. 请注意,SVN和Mercurial或Git等分布式系统之间的主要区别在于SVN的“签出”命令仅下载每个文件的最新版本的副本,而使用hg clone ,实际上最终会得到存储库的本地副本整个历史也是如此。 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. 例如,您需要与服务器建立网络连接才能检索日志,执行差异等。

If you just need to grab the current version, svn checkout is all you need. 如果您只需要获取当前版本, svn checkout需要svn checkout

If you want a complete copy of the repository, including all previous versions, you can use svnsync . 如果需要存储库的完整副本(包括所有先前版本),则可以使用svnsync It can copy a complete repository and incrementally download new commits. 它可以复制完整的存储库并逐步下载新的提交。 I don't think it can be restricted to subdirectories though. 我不认为它可以限制在子目录中。

  1. You can't clone the repository without having admin access to it (ie the ability to do svnadmin commands). 如果没有管理员访问权限(即能够执行svnadmin命令),则无法克隆存储库。
  2. You can certainly check out the subtree with svn co http://....../docs 您当然可以使用svn co http://....../docs查看子树
svn co svn://www.example.com/path/to/repository/...

其中“co”是“结账”的缩写。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM