views:

181

answers:

4

Hi I'm new to SVN and would like to know a couple of things or if someone can point me in the right direction either advice or some sites to read.

I have subversion and tortoise installed and have subversion installed correctly but I would like to know how I can work on files in my htdocs folder from my machine and then commit the files and once I commit they are transferred to my htdocs folder and are ready to view when i go to the localhost.

Thanks in advance.

A: 

I'm not sure you are grasping what SVN is doing for you. It's maintaining a history of the changes you make to your files through checkpoints you create on each commit. The files themselves remain where they are in your file structure.

It sounds like you are looking for a kind of deployment tool that would place your working files into your development server (on your machine) ready for testing, that's not what SVN is for. I'm not sure what the solution might be but I'm sure someone here can give you the answer you need.

Lazarus
+3  A: 

This question isn't entirely clear, but I take it to mean that you want to work on a copy of your data in the htdocs folder on your local machine, view them via the web server on your local machine and, when you are happy, commit the changes and roll them out on the production machine.

If so, congratulations! This is an excellent way to work.

This is exactly what we do (to the point of running local versions of entire dynamic applications). We commit on a regular basis and then, to do a release, just go to the server and do an svn update in the checkout of htdocs (or whatever) on the server. This could be automated with a cron job, but we like to do it manually since it ensures that the head gets a sanity check first, and if something goes weird with the update, there's someone right there to deal with it.

To get started:

  • create an htdocs and some files on your development machine
  • svn import that directory
  • go to your production machine, and svn checkout the htdocs dir
Curt Sampson
Nice approach! That's something I'll look at for some of my development, thanks.
Lazarus
i dont think that having a working copy on your production is such a good ideea, it doesnt give you the posibility for oredeploy checks of the code, reverting to old version if something goes wrong
solomongaby
Hm? We revert just fine; you just need to svn update to whatever particular revision you'd like to revert to.
Curt Sampson
I should make it clear, what's on the server would not be considered a traditional "working copy" as one doesn't modify it directly.
Curt Sampson
A: 

Seems too little for full-blown CI like CruiseControl.NET with Nant. The easiest way would be to create a batch file that both commits and copies to htdocs. Something like

svn ci %message
robocopy . c:\htdocs

Name that commit.bat and call it with commit "this is my message"

Matt Hinze
A: 

When you commit, the files are transferred to the internal repository of the SVN server and they are not directly viewable. However any client can update his/her contents and the changes will be visible.

Anyway start from the SVN book. This article is also very useful.

kgiannakakis