Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 (i.e. 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.

like image 482
Charles Ma Avatar asked Jun 27 '09 12:06

Charles Ma


People also ask

Can I delete .svn folder?

There is only one . svn folder, located in the base of the working copy. If you are using 1.7, then just deleting the . svn folder and its contents is an easy solution (regardless of using TortoiseSVN or command line tools).

Where is the .svn folder?

- the only . svn folder is in the root folder now, and this contains all of the info for the checkout. You should now be able to simply copy the folder and check it in.

How do I clean up a .svn folder?

According to this answer and SVN change log, svn cleanup has an option to vacuum pristine copies ( /vacuum ). This is done by default starting from 1.8. From version 1.10 up it is not longer done by default, but can be run using the command svn cleanup --vacuum-pristines (see this answer).


2 Answers

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.

like image 100
laalto Avatar answered Sep 21 '22 15:09

laalto


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.

like image 36
Rhythmic Fistman Avatar answered Sep 20 '22 15:09

Rhythmic Fistman