I'm doing svn update to update the code for my php website, but it leaves .svn/
folders all over.
I think its dangerous to leave those files publically readable, but its very easy to update the system.
Is there a way to use svn update
to update the system, but not to export the .svn/
folders?
If you are using apache:
That will block people from accessing
.svn
directories remotely (using the browser) but you can keep then (and svn capabilities) on the project.BTW you can substitute
\.svn
for\.git
or\.cvs
if you are using something different than subversion.you should change apache configuration so that it denies acess to .svn folder. this thread has more info https://stackoverflow.com/questions/398008/deny-access-to-svn-folders-on-apache
You are wanting to export your code from the SVN to the live site...
Don't use
svn update
for that. update is meant for use with updating working copies, not exporting the code. Usesvn export
instead as it exports a clean directory tree from the repository specified.The
--force
flag will allow the export to overwrite the existing files.SVN Export manual entry
I dont put them into production/live sites. Coz I dont want me and/or other developers forgetting what a bad idea it is to edit live code. My install script filters my .svn files out.
You should look into a proper deployment system, such as Capistrano. This means your production servers don't need subversion, and you can deploy to multiple servers and add custom logic to deployments. It also makes it relatively easy to roll back deployments.