简体   繁体   中英

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.

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?

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.

svn export works similarly to a checkout but without the .svn directories. However, you cannot update such a structure since it's not a svn working copy.

You can also configure the web server to disallow access to the .svn directories and just go with the checkout+update method.

How about rsync configured to not copy ".svn" directories?

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

This can be re-run to refresh the webserver's copy.

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. Obviously this isn't a straight forward solution though.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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