CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Peter's Gekko

public Blog MyNotepad : Imho { }

Getting started with subversion

Good tools are half the job. Being a one person shop I believed VSS was good enough for my source control needs. Almost everybody says Subversion is a far better alternative. The main advantage mentioned is (beside stability and all that) the different and better way subversion handles multiple users working on the same file. As a one person shop that's not that important. The main downside mentioned is a somewhat steep learning curve. But recently, after another frustrating struggle with VSS, I had enough and spent my energy on an exploration of Subversion.

It was a delight. The learning curve is by far not as steep as I feared. Besides that the documentation included is quite good. My only problem was to find a good starting point. I found this in TortoiseSVN, which presents itself as just a client but does contain everything I need. The help files tell all you want to know about Subversion and more. Here I'll just summarize the things you need for a jumpstart.

TortoiseSVN presents itself as a shell extension. So it is available in all explorer windows. Subversions stores the sources (or any other file) of a project in a repository. A repository is a folder in the file system. The procedure to create a repository and a working copy is different than VSS, there is no such thing as "Add to source control". You have to create and fill the repository first and create a new working copy after that. These are the steps:

  • Install TortoiseSVN
  • Create a folder to store your repositories. After setting up a repository you will not work with this folder yourself. All interaction runs through the TortoiseSVN shell extensions
  • Setup a template folder. This folder describes the structure of new repositories. Recommended is the trunk/branches/tag tree you meet everywhere in subversion docs.
  • Create new empty folder for the project.
  • Right click it and pick create repository here in the TortoiseSVN context menu. This will fail when the folder is not empty.
  • Select the template folder and pick Import in the TortoiseSVN context menu. You will be asked for a repository. Select the repository folder for the project you just created.
  • Select the folder of the project you want to add to the repository. Again pick Import from the context menu. Select the repository and pick the trunk folder.
  • Create a new empty working folder for the project.
  • In the context menu pick SVN checkout and select the repository. TortoiseSVN will warn when the folder is not empty.

And now source control is fully integrated in the windows explorer, including all dialogs. An update from or a commit to the repository are just a context click away. TortoiseSVN presents the status of the folder in icon overlays.

You don't want all files to be under control. Because they muddle up your repository, but also because they spoil the visible status. Just building the project would turn the icon of the root folder red. TortoiseSVN has loads off ways to describe excluded files. I'm still wrestling somewhat with the list. So far I've come up with

*.dll* *.pdb *.CACHE  _ReSharper.* *resharper* Iesi.Collections.xml Castle.DynamicProxy.xml log4net.xml NHibernate.xml

But there will be a better way without any doubt. There is also a Visual Studio add-in for SVN, the only Subversion commercial product I know of. (Yes, also subversion is an open source project) But I haven't looked at that yet.

I have only talked about this client tool. For the moment this does fulfill all my needs. I can reach repositories over the network using a file url like  file://HARAHARA/Users/Peter/SubversionRepositories/Gekko\Website/trunk (mind the (back-)slashes). In case I need more, there is whole load of subversion servers available for any platform.

That's about it. Another great tool added to my box.



Comments

Pages tagged "learning" said:

Pingback from  Pages tagged "learning"

# May 22, 2008 5:18 AM

Jeremy said:

Some other useful wilcards for svn:ignore properties on folders:

*.suo

*.FileList.txt

*.FileListAbsolute.txt

Thumbs.db

build.force

By the way, have you noticed yet that Tortoise adds a "Subversion" tab to the regular Windows Explorer folder properties dialog? This is very useful as it lets you add all your ignore properties to the root folder, and apply them recursively down the tree.

# May 22, 2008 7:01 AM

Gabriel Lozano-Moran said:

Try AnkhSVN and to be more specific one of the pre-release versions of one of the nightly builds of version 2.0.

ankhsvn.open.collab.net/.../ProjectDocumentList

# May 22, 2008 7:08 AM

karl said:

Here's my ignore list:

log bin obj Logs *.user *.suo Thumbs.db *.Publish.xml _ReSharper* *.resharper globals_user.php *.sqlite.db db/schema.db tmp *.class *.iws out

# May 22, 2008 8:52 AM

pvanooijen said:

Thanks everybody for your ignore lists.

@Jeremy: Yes I did notice that one. And that's quite a powerfull tab. The nice thing about tortoise that it's UI adapts so wonderfully well to what's (not) possible. Very, very intuitive

# May 22, 2008 9:02 AM

Darrell Mozingo said:

You should definitely give VisualSVN a shot. Integrates seamlessly with Visual Studio and the price isn't too bad. They make a one-click (or close to it) SVN server install package too, which has worked quite well for me in the past.

# May 22, 2008 9:16 AM

Rafael Rosa said:

Hi.

SVN is great, but if your changing tools I would recomend you to take a look at Git. It's quite new, but seems to be the replacement tools for SVN, and is gaining momentum. It was designed by Linus Torvalds and is used to manage the Linux kernel, Ruby on Rails and many others.

Besides that, it's easy to integrate it with SVN repositories, and there's a new tool to use it under Windows, called MSys on Git. Needless to say, it's all open source :)

Official site: http://git.or.cz/

MSys on Git : code.google.com/.../msysgit

Best regards,

Rafael.

# May 22, 2008 10:38 AM

Kyle Baley said:

AnkhSVN wasn't ready for primetime when I first looked at it a year ago. VisualSVN is priced at the right side of the "how much billable time is this product going to save me?" equation.

# May 22, 2008 3:17 PM

ADO.NET programming said:

" Being a one person shop ". So am I. Been using SourceGear Vault ( free for one person). At least the standalone GUI is like VSS (not using it integrated) and SQL Server/webservice based = I can access it from anywhere. Actually I did try Subversion, but as you say, steep earning curve if you're from the VSS world.

# May 22, 2008 4:15 PM

pvanooijen said:

As stated in the post I found the learning curve not that steep at all. The help files of tortoise are very very good.

When it comes to functionality subvesrion far better fits than VSS

# May 23, 2008 6:17 AM

Arjan`s World » LINKBLOG for May 23, 2008 said:

Pingback from  Arjan`s World    » LINKBLOG for May 23, 2008

# May 23, 2008 4:23 PM

Luciano Evaristo Guerche (Gorše) said:

I would recommend you:

1) VisualSVN

www.visualsvn.com/download.html

2) VisualSVN Server

www.visualsvn.com/server

3) Git (from Linus Torvalds)

en.wikipedia.org/.../Git_(software)

http://git.or.cz/

4) Bazaar (from Canonical Ltd., the maker of Ubuntu)

http://bazaar-vcs.org/

--

Luciano Evaristo Guerche (Gorše)

Taboão da Serra, SP, Brazil

# May 26, 2008 3:57 PM

Peter's Gekko said:

Almost holiday time, time to tidy up all work. Recently I moved to Tortoise SVN for all my source control

# June 30, 2008 10:06 AM

Community Blogs said:

Almost holiday time, time to tidy up all work. Recently I moved to Tortoise SVN for all my source control

# June 30, 2008 10:28 AM

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add
Check out Devlicio.us!

This Blog

Syndication

News