简体   繁体   English

没有.svn目录的svn checkout和update

[英]svn checkout and update without the .svn directory

I have a website under svn and I want to patch the live website with what's currently in the repository (ie effectively calling svn update on the live website), but I don't want .svn directories in every folder on the production website. 我在svn下有一个网站,我想用实际存储库中的内容修补实时网站(即在实时网站上有效地调用svn更新),但我不想在生产网站上的每个文件夹中使用.svn目录。

Is there a way to set up svn so that the .svn folder with version information is not in the same directory as the files under version control? 有没有办法设置svn,以便具有版本信息的.svn文件夹与版本控制下的文件不在同一目录中?

In git you can create and detatch a work tree and push updates to a project this way(according to http://toroid.org/ams/git-website-howto ), I basically want to be able to do something similar in svn. 在git中,您可以创建和分离工作树并以这种方式将更新推送到项目(根据http://toroid.org/ams/git-website-howto ),我基本上希望能够在svn中执行类似的操作。

svn export works similarly to a checkout but without the .svn directories. svn exportcheckout类似,但没有.svn目录。 However, you cannot update such a structure since it's not a svn working copy. 但是,您无法update此类结构,因为它不是svn工作副本。

You can also configure the web server to disallow access to the .svn directories and just go with the checkout+update method. 您还可以将Web服务器配置为禁止访问.svn目录,并使用checkout + update方法。

How about rsync configured to not copy ".svn" directories? 如何配置rsync不复制“.svn”目录?

rsync --exclude=.svn local_svn_copy webserver:site/

This can be re-run to refresh the webserver's copy. 可以重新运行以刷新Web服务器的副本。

httpd.conf: httpd.conf中:

<Directory ~ "\.svn">
    Order allow,deny
    Deny from all
</Directory>

正如laalto所提到的, svn export为重复使用时更新“工作副本”提供了一种简单但不是非常有效的方法:

milen@dev:~$ svn export --non-interactive --force "<URL>" <directory>

You could also use git-svn to create a git mirror of the website and then publish the way described in the article you linked. 您还可以使用git-svn创建网站的git镜像,然后发布您链接的文章中描述的方式。 Obviously this isn't a straight forward solution though. 显然,这不是一个直接的解决方案。

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

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