tags:

views:

76

answers:

3

A little background first:

I'm a designer/developer and decided to use subversion for a personal project. I'm the only one working on this project. I've setup a Beanstalk account and installed Versions on Mac. Locally I have MySQL and PHP running through MAMP.

First thing I did in Versions is click the 'checkout' button. I selected my webroot folder on my local machine and a folder has been created with three subfolders: branches, tags, trunk. I don't understand what to do with this. My code lives in the webroot and a bunch of subfolders and I can't move my code to any of the three folders without breaking things.

So, my question is, how do I tell Versions that my code is in the webroot folder and not in the folder it created itself?

+2  A: 

When you check out your working copy, you should check out the "trunk" rather than the repository root. I'm not familiar with Beanstalk, but I'd imagine you'd have some sort of repository URL assigned to you, like this:

https://www.example.com/repos/will/

Instead of checking out that URL, you want to check out

https://www.example.com/repos/will/trunk

into your webroot directory. For more information on branches, tags, and about how subversion repositories are conventionally organized, see http://svnbook.red-bean.com/en/1.5/svn.reposadmin.planning.html#svn.reposadmin.projects.chooselayout .

Will
I'm totally confused... I did a checkout (of an empty project) without any problem. The problem is that my code does not live in the folders Versions created and thus there is nothing to commit. So how do I tell Versions my code lives somewhere else?
bart
+1  A: 

Based on your description, it doesn't look like you have set up your repository. You might want to do some reading on Subversion...no GUI will prepare you for proper use. Here's a link to a free book: http://svnbook.red-bean.com/ and in particular, this is a reference to importing your files: http://svnbook.red-bean.com/en/1.5/svn.tour.importing.html

Michael Dean
+2  A: 

"Checkout" is used to grab code from subversion to your local machine. Since you had not done that yet, it basically checked out an empty project.

What you want to do is "Import". Import your project into /trunk in subversion. Then, you can checkout from /trunk if you ever need to, or if you want to create a second copy on your local machine.

In the meantime, whenever you want to save changes, you "commit" them to subversion.

/trunk is meant to be used as your working codebase. It is the most current version of what you know to be working (minus some bugs, of course).

/branches are meant to be used to create large features that may take a while. In this case, you may not want a bunch of new code for that feature getting mixed into your working codebase. This may cause some problems for you, so you may want to keep them separate. To do this, create a subfolder in /branches for each feature.

/tags are used for "tagging" working copies such as a beta or a release version of your code. A t tag basically takes a copy of the entire codebase at that time. Later on, you can come back to that tag and get an exact version of your codebase when that tag was created. Just like with /branches, you will want to create subfolders for tags.

Kevin Crowell
Instead of export, do you mean "import"? I believe it should read, "First you need to *import* your project into subversion".
Will
@Will Yes, fixed. Thank you.
Kevin Crowell
Still don't get it. I have only code on my local machine right now and never performed a commit. If I hit 'update' in Versions nothing is added because the 'branches', 'trunk' and 'tags' folders are empty. Does this mean I manually have to copy all my files from my webroot to one of these three folders?
bart
@bartclaeys The key part of my explanation (which I bolded now) is that you need to import your project to subversion before you can actually take advantage of subversion's features. The rest of my post answers your question (what are the branches, tags, and trunk folders).
Kevin Crowell
@Kevin Thanks, but then my question is, how do I import my code? I guess by copying it locally from my webroot folder to the /trunk folder?
bart
@bartclaeys I suggest you look through the subversion FAQ. Especially any part that mentions "import". http://subversion.apache.org/faq.html#repository
Kevin Crowell