views:

75

answers:

2

Hello, I'm new to using Subversion and have just set up the following - SVN on a remote server and SVN on a local PC. I have created a repo on the remote server at /repos, then i (svn) imported a live website's files into that repo. I then checked out (using svn+ssh) a working copy to my local PC, directly into a local LAMP setup under /var/www, so that I can preview any changes i make on a local web server, before committing back to the remote repo. Two questions really - is this a sensible set up for a beginner? Is it ok that I don't actually have a working copy on the remote server, just the main repo for each site?

Also, how can i use svn:ignore properly to avoid checkout database config files and useless directories like mail, log, tmp etc? I've looked at the book and am still not entirely sure, any help appreciated!

+3  A: 

svn:ignore is not used to avoid checking things out, but to avoid checking things in. You should remove those files from your repository, and then set the svn:ignore property on your working copy so that they will not be inadvertantly checked back in.

You can use svn delete --keep-local on your working copy, and then commit to have the files removed from the repository.

As for your setup, you would not want to have a working copy on the remote server; instead, to deploy the files, you would use svn export of a known good revision.

Michael Hackner
Thanks for the clarification Michael, so i should just clean up my files and directories on the remote server before checking them out as working copies. Any additional config files I use locally should be ignored using svn:ignore. Cheers for the tip about svn export too
kenny99
+1  A: 

Your setup sounds very sensible. You seem to have confused your naming though, which probably leads to your insecurity: The place where all revisions are stored is called a "repository". The place where you have a (copy of a) specific revision to work with it, is called the "working directory" or short "checkout". You can have as many checkouts as you need from a single repository.

As Michael noted, it can make sense to use svn export instead of checkout to avoid publishing the .svn/ on your production server.

David Schmitt