|Having latest copy of SVN'ed files in document root||#1|
A while back I asked link text and I got some great answers. What I would like to know is if there is a way to keep the files under my web applications document root, and when I make a change, commit them back to the repository.
From what I understand, in order to work on files, they can(t be in the web root. Having to move them out to somewhere else just to work on them seems counter-intuitive to me. Am I missing something?
posted date: 2009-04-10 07:51:00
|Re: Having latest copy of SVN'ed files in document root||#3|
Just check out the svn repo to a directory and make that directory the web root. You will want to have an apache policy that will not serve the .svn directory but other than that there is no issue.This is what I have in my httpd.conf to protect svn directories:
#Protect svn directories
<DirectoryMatch "^/.*/(\.svn|CVS)/"> Order deny,allow Deny from all
posted date: 2009-04-10 08:00:00
|Re: Having latest copy of SVN'ed files in document root||#4|
So say I have a web site at C:\www\samples\htdocs\. I would have the actual repository somewhere else and check out into C:\www\samples\htdocs\? What about the fact it says it should be an empty directory?
posted date: 2009-04-10 08:04:00
|Re: Having latest copy of SVN'ed files in document root||#5|
I can't see windows being that much different. In general, I'd go to /var/www/ and checkout a copy that would make a directory something like /var/www/my_repo In apache I'd set my doc root to /var/www/my_repo
posted date: 2009-04-10 08:13:00
|Re: Having latest copy of SVN'ed files in document root||#6|
You can use the "svn:ignore" property to allow other items in document root without them being checked into svn. Easiest way is to checkout from SVN into EMPTY document root, then copy in other items and mark each with svn:ignore, then check in document root to record the svn:ignore properties.
posted date: 2009-04-10 08:34:00
|Re: Having latest copy of SVN'ed files in document root||#7|
For what it's worth, in Linux at least you can check out into a nonempty directory as long as the existing files don't have the same names as the ones you're checking out.
posted date: 2009-04-10 09:17:00
|Re: Having latest copy of SVN'ed files in document root||#8|
in order to work on files, they can(t be in the web rootThere(s no truth to that. Maybe you(re thinking of the fact that files which can be modified/edited by the web server shouldn(t be under the document root. But as long as you(re not using the server itself to do the editing (which would be the case if, say, you created some kind of text editor web application), it(s perfectly fine and a completely normal practice to edit files in the document root.You might be interested in something like my setup: I have the repository which holds my website on the same physical machine as my web server. One working copy is checked out into the web root on that machine, and I have another working copy checked out on my laptop, where I do my development and testing. Now the fun part: I added a hook to the SVN repository so that every time anything is committed to the repository, it automatically updates the working copy in the web root. This way the web root always has the latest revision of the website code, but I can still work on the site without having access to the server.EDIT: here(s the script
posted date: 2009-04-10 09:24:00
|Re: Having latest copy of SVN'ed files in document root||#9|
I would definitely be interested in that....that is exactly what I am invisioning. Thanks!
posted date: 2009-04-10 10:42:00
|Re: Having latest copy of SVN'ed files in document root||#10|
Thanks for the tips! I accepted the other answer as to the fact it seems exactly what I was envisioning but these all give me some insight as well.
posted date: 2009-04-10 10:43:00
|select page: « 1 »|