Geeks making the world a bit better.

Trying out SVN

I really ought to use source code control. I know it. But my laziness combined with my poor memory, makes it hard.

I’m trying out subversion. I’ll make some notes here to help me remember.

To create a new project myproject in my repository I need to:

cd ~/Desktop
mkdir myproject
cd myproject
mkdir trunk tags branches
cp -r path_to_myproject_files/* trunk/
clean up any junk files
svn import ~/Desktop/myproject svn+ssh://gb@cvs.cs.unc.edu/cvs/user/gb/svn/myproject -m "initial import"
cd place_to_work
mv path_to_myproject_files out of the way if necessary
svn checkout svn+ssh://gb@cvs.cs.unc.edu/cvs/user/gb/svn/myproject/trunk myproject

Then in that working directory the commands to know are: svn add, svn update, and svn commit.

4 comments

#1 Jo Vermeulen on 07.07.08 at 3:45 am

If you don’t like SVN, give Bazaar a try.

It has an easy-to-use (command-line) user interface and is a distributed version control system. This means you can commit changes without network access and push them later when you are back online. There is no difference between a working copy (checkout) or a repository.

It does not require a specialized server to push and pull changes (although you can do so to speed up things). You can just push through SFTP and pull through HTTP. Furthermore, it has a plugin to pull changes from and commit changes to SVN.

Here’s how to start a new project with Bazaar, add some files and push it:

$ mkdir my-project
$ cd my-project
$ bzr init # initialize repository
$ emacs script.py # edit file
$ bzr add script.py # add a file
$ bzr commit -m “First revision.” # commit
$ bzr push sftp://gb@cs.unc.edu/home/gb/public_html/my-project # publish it somewhere

If you want to continue working on it from another computer:

$ bzr get http://cs.unc.edu/~gb/my-project

or (bzr has command aliases to make it easier to switch from other version control systems):

$ bzr checkout http://cs.unc.edu/~gb/my-project

My personal preference is to use a distributed system like bzr or git, but of course you should choose what you feel comfortable with :-)

#2 Steve Lee on 07.07.08 at 4:54 am

It sure gives a nice sense of safety.

Now I’ve got used to svn i’m thinking I should look at git (or another distributed VC) as you don’t need a server. SO yo ucan just use local vc when on your self but still share and then use server if that makes sense as project grows. Well that’s the theory and it seems git plays really nicely with svn

#3 Capt. Jean-Luc Pikachu on 07.08.08 at 12:07 pm

These 3 links really helped me get SVN working on my own machine:

http://www.onlamp.com/lpt/a/2820
http://blog.excastle.com/2005/05/31/mere-moments-guide-to-installing-a-subversion-server-on-windows/
http://blog.excastle.com/2008/01/02/installing-subversion-14-as-a-windows-service/

Definitely check out tortoisesvn, it does so much of the hard work for you.

Good luck!

#4 Ritesh Kumar on 08.19.08 at 7:05 pm

Hi Gary!

You might want to try one of the distributed revisioning systems (you could use them for more than just source code revisioning). Most of them don’t require going over the network at all but give you an option to do so. I find them conceptually simpler and operationally easier to work with than central repository oriented systems. But that may be because I started with distributed revisioning before central revisioning :).

Mercurial http://www.selenic.com/mercurial/wiki/ is a simple and easy to use distributed versioning system. git http://git.or.cz/ is slightly more complicated. However, it has really nice and lightweight branching which is really helpful once you are working on a project which is complicated enough.

Feel free to send me email if you would like more information. In particular, if you let me know your pain points w.r.t svn, I should be able to tell you whether mercurial or git would help. I have been using both mercurial and git for a while now.

Leave a Comment