ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

How to use Subversion?

October 10, 2008 2:46pm

Subscribe [7]
  • #1 / Oct 10, 2008 2:46pm

    Mark Bowen

    12637 posts

    Hiya,

    Just wondering if anyone could possibly give me a quick tutorial on how exactly to use Subversion. I downloaded a nice looking programme called Cornerstone for OSX but now I am lost!

    I thought that I would be able to import files into it and then make updates and it would track all the changes? I just can’t seem to figure out how to go about doing this.

    If anyone has an idea of how to use this programme and how I go about doing everything then that would be great thanks.

    Best wishes,

    Mark

  • #2 / Oct 10, 2008 7:09pm

    Pascal Kriete

    2589 posts

    The first thing you need is a server.  Subversion is a client-server type of deal.  You could install that on your local machine as well, but I don’t know how easy it would be (best guess: not easy).

    A bunch of places online offer free svn hosting.  My favorites:
    Assembla (unlimited projects - [Edit 200MB not 500 .. didn’t check my facts])
    Beanstalk (only 1 free project, but amazing integration with other apis)

    Once you’re connected, you create a working copy (depends on the program, running a svn export will do it), toss your files into that folder and hit commit.  Any changes you make to those files from that point on will be flagged, with the option to commit them as well.

    One suggestion before I leave you to it - after your initial commit, keep future commits small.  It makes it a lot easier to go back when you’ve screwed up.

    For the whole banana, read the most excellent (and free) svn book.

  • #3 / Oct 11, 2008 10:40pm

    Leevi Graham

    1143 posts

    Hiya,

    Just wondering if anyone could possibly give me a quick tutorial on how exactly to use Subversion. I downloaded a nice looking programme called Cornerstone for OSX but now I am lost!

    I thought that I would be able to import files into it and then make updates and it would track all the changes? I just can’t seem to figure out how to go about doing this.

    If anyone has an idea of how to use this programme and how I go about doing everything then that would be great thanks.

    Best wishes,

    Mark

    Hey Mark,

    Theres also Versions which you might want to try out.

    Also if you want to go a bit crazy there is also GIT which seems to be better than Subversion and is picking up a lot of steam in the dev world.

    Cheers

  • #4 / Oct 12, 2008 8:09am

    Mark Bowen

    12637 posts

    Well I think that I have to admit that all of this has gone right over my head. I was just looking at Collabnet whilst reading that it’s possible to install SVN on OSX but after installing the download there I am completely lost.

    I don’t really want to have to pay for online storage as I simply don’t agree with that kind of thing as it is just WAAAAYY too costly for my liking so if I can’t get all of this to work I think I am going to just admit an early defeat :down:

    Thanks for the links though guys.

    Best wishes,

    Mark

  • #5 / Oct 12, 2008 10:40am

    gridonic

    231 posts

    Just wanted to post this, but saw that inparo was faster.

    SVN is a must in my eyes, at least for people that write software or even pieces of it. I’d read the Book inparo mentioned as it gives you a very good oversight on what SVN is about, eventough it does not talk about graphical clients, but at least you know what SVN is afterwards.

    Happy commiting 😉

  • #6 / Oct 12, 2008 1:31pm

    Mark Bowen

    12637 posts

    Hiya,

    Thanks. Actually I have seen and read a lot of that book as it comes as the main help file for the Cornerstone app that I mentioned before. Unfortunately this still doesn’t get me any closer to getting a server set up on my computer and I really really am against paying for space online to do all of this as it is simply just too expensive.

    I installed the package from the Collabnet web-site but now am completely lost with what to do :down:

    I think I’m going to give in on this for now and just do things the way I always have, multiple copies!!!

    Best wishes,

    Mark

  • #7 / Oct 12, 2008 2:32pm

    gridonic

    231 posts

    I think I’m going to give in on this for now and just do things the way I always have, multiple copies!!!

    Oh no, this is so not how today the hard- and software should help you be more productive.

    There are several free hosted SVN server, one that I know is google, but then I guess your code would be made public, several others offer free packages (e.g. http://www.projxpert.com) you could use for starters.

    We use a paid svn hosting, something I found by quickly searching the web:

    http://developer.apple.com/tools/subversionxcode.html
    http://www.devdaily.com/blog/post/mac-os-x/installing-subversion-svn-server-on-mac-os-x/
    http://www.macpot.com/archives/2005/07/tutorial_subver.html

    which should get you started.

    Regards
    Peter.

  • #8 / Oct 12, 2008 4:39pm

    Pascal Kriete

    2589 posts

    The first one I mentioned is free as well.  The question is how much space you need.  If you have macports you can install it quite easily that way:

    sudo port install subversion +tools
  • #9 / Oct 12, 2008 6:40pm

    Jesse B.

    33 posts

    Hey Mark, I don’t know how comfortable you are with the concepts, so let me start from the beginning.

    You need two directories with Subversion: the repository and the working copy.

    The repository is the database that holds all the files and their revisions, log changes, etc.  The repository is in a format that’s not meant to be edited directly; you only use Subversion to interact with it.

    The working copy is where you do most of your work.  Working copies are just plain directories with your files, except that they have a hidden .svn directory within each directory.  The .svn directory contains all the data necessary to sync your working copy with its matching repository.

    To start with Subversion, you first create a repository.  If you have the command-line files from Collabnet, try this command:

    svnadmin create ~/svn

    That creates an empty repository in a folder called svn in your Mac’s home directory.  (You’re using a Mac, correct?)  If you’d prefer, you can put the repository anywhere else; just make sure to substitute the correct path in the rest of these instructions.

    Next, you need to create a working copy.  Type this:

    svn co file:///Users/Mark/svn ~/wc

    (Substitute the appropriate path to the repository.)  When you do, Subversion should respond with this:

    Checked out revision 0.

    Next, you can move into the ~/wc directory and make any changes you want.  One question you should answer very quickly is how you want to structure your repository.  Here are some questions:

    * Do you want to put multiple projects in one repository, or make one repository for each project?  (I’ve done the former so far, but I’m not confident that that’s the best way.)
    * How do you layout your file structure?  Subversion recommends creating three folders: trunk, branches, and tags.  I add a fourth folder called resources.  trunk holds my final, ready-for-publication pages and sites.  resources holds things like PSDs, copy from clients that usually comes in Microsoft Word or some other ugly format, notes, etc.  branches and tags hold copies of trunk at various stages of development; you don’t need to worry about that at first.

    To create directories, type:

    svn mkdir trunk
    svn mkdir branches

    etc.

    To add files, just get it into the working copy using any method that works for you (Finder, saving it with Dreamweaver, etc.).  Next, you need to tell Subversion to process a new file:

    svn add trunk/foo.html

    When you modify a file, you don’t need to tell Subversion about it.  It’ll notice automatically.

    When you’ve finished an editing session, you’ll want to commit your changes.  I generally commit when I’ve made all the edits to accomplish a particular task.  To commit your changes:

    svn ci

    You’ll be asked to type a log message.  This is a note to explain to yourself what you did and why.  Once you save and quit, the files will get uploaded to the repository, along with your log message.

    Once you understand the concepts, working with the GUIs becomes much easier.  Things to note:

    * You have to tell Subversion when you add or delete stuff, or move things around, but not when you modify files that already exist.
    * Subversion is extremely powerful, but you don’t need to worry about that for now.  If you can get started just making changes to a working copy and then committing it, you will begin generating the logs and other features that make Subversion powerful.  That way, they’ll be there for you when you’re ready to venture into the next step.
    * If you’re not using Subversion 1.5, you really should be.  It adds some features that will help you out later on.

    If you need more help, the Subversion Book is really good.  It’s written for advanced beginners, which is probably what I would call you when it comes to version control.

    Of course, I’d love to help if possible, also.  Friends don’t let friends keep multiple copies of files.

    Take care!

  • #10 / Oct 13, 2008 1:57pm

    trif3cta

    148 posts

    Thanks Jesse B, that filled in a few gaps for me.

    Sidenote:  GitHub is a great community sort of thing, but Git itself is quite confusing.

    The Versions/Beanstalk combo seems to be the route for us design types.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases