Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Learning how to use Subversion

This is probably a really stupid newbie-sounding question to you developer type people, but I'm at a loss :( I've been trying to learn how to use Subversion for keeping the history of my code, but I'm finding it pretty confusing. I read the 'book' that comes with Subversion, but I didn't find it all that helpful. I'm using Windows, and I downloaded the TortoiseSVN GUI for it.

All I really want to know how to do is to create a new project, put a file in it (any old file), and then update that file, just so I can see how it works. I created a 'repository' (in svn_repository/test), and if anyone could tell me how I'm supposed to go about creating a new file/putting a file in it, and then updating that file I'd be really happy :) Knowing my luck it'll be something as simple as "drag and drop the file into the directory". Apologies for asking such a stupid question!

Also if anyone could tell me how to go about making it work with Zend Studio, that would be extra awesome-points. Thanks!

like image 236
nationale Avatar asked Sep 24 '08 00:09

nationale


Video Answer


2 Answers

The recommended directory structure for a subversion repo contains three folders: "branches", "tags" and "trunk". So, create these folders somewhere convenient, in a new folder.

Right click in the parent folder of these folders, go to TortoiseSVN and select Import. Enter the url to the repository you created here (ie_ https://JUNK:8443/svn/Test/ is one I just made, on my local machine). Hit the ok button and the folders will be imported.

Now browse to where you want the repo to live on your local machine (I've gone to C:\workspace\test). Right-click and go to SVN Checkout.

Now, you want to check out from the trunk of your repo, so change the repository URL to reflect this (https://JUNK:8443/svn/Test/trunk/). Hit the ok button.

Create a new file in this directory. Right click on it and go to TortoiseSVN, then Add. Hit ok, and the file is now marked as a new file for the repo. Right click in the parent folder of the file and you should see SVN Update and SVN Commit. SVN Update will refresh the local files with files from the repository. SVN Commit will send local files that have been changed back into the repository.

Have fun :)

like image 177
rjohnston Avatar answered Oct 13 '22 00:10

rjohnston


Often when I create a new project I have to refer to the SVN Quickstart guide.

It takes you through creating a new repository, the initial import, and how to check your files out and back in (on the command line).

The book is very helpful, but you'll get the best value out of it after you've been using version control for a little while and understand the concepts better.

(Note the terminology in bold below)

If you're using TortoiseSVN, you'll have to create the repository, and then import your files (if you have any) when starting up. After that you check out the project to a working folder and can just create files in the working folder and then add them easily. Once the repository is created you only interact through it via your Subversion client.

like image 27
Harley Holcombe Avatar answered Oct 13 '22 00:10

Harley Holcombe