Rick Strahl's Weblog  

Wind, waves, code and everything in between...
.NET • C# • Markdown • WPF • All Things Web
Contact   •   Articles   •   Products   •   Support   •   Advertise
Sponsored by:
Markdown Monster - The Markdown Editor for Windows

Setting up and running Subversion and Tortoise SVN


:P
On this page:

Since I've been working with Subversion a bit recently I thought I'd write up a quick step by step guide to getting started with Subversion and Tortoise SVN. Actually this has had a practical side to it - I have a couple of developers on a project that needed to get a quick start and get them up and running with the same base line, so this write up was the result.

There are actually several documents out there that do something similar and the Subversion and the Tortoise SVN documentation in particular are actually quite good at explaining the details of using Subversion. However I found myself floundering a little when first setting up Subversion, getting the the Subversion Service set up and then using Tortoise to hook up to Subversion, creating new source control branches and then creating and using new local copies from the repository. My approach includes a little more hand holding I suppose so I hope some of you may find this useful if you've been thinking about checking out Subversion for the first time.

 I'm no source control wiz and this is an intro article - it deals mainly with the configuration and setup end of things not the intricacies of using source control effectively. So you can think of this as a setup and get going guide.

The article can be found here:

http://www.west-wind.com/presentations/subversion/

Posted in .NET  Source Control  

The Voices of Reason


 

Paul Mrozowski
August 08, 2007

# re: Setting up and running Subversion and Tortoise SVN

Your timing on this stuff, as always, is great. I've been holding off installing this stuff at the office because I couldn't remember all the little things I needed to do to get it up and running (I should have taken notes). I think open-source docs are allergic to screenshots (and in some cases, docs altogether).

Thanks,

Steve from Pleasant Hill
August 08, 2007

# re: Setting up and running Subversion and Tortoise SVN

Actually, I would have preferred this about a year ago :-).

Have had a bitch of a time breaking the Vulcan-mind-meld like control VSS has on me, and I also usually avoid using software that I have to install in stages from more than 1 source.

Thanks!

JM
August 08, 2007

# re: Setting up and running Subversion and Tortoise SVN

I recommend you that try VisualSVN a plugin for the visual studio to work with SVN it's very good.

http://www.visualsvn.com/

Paul Mrozowski
August 08, 2007

# re: Setting up and running Subversion and Tortoise SVN

I just finished getting this up and running and checking my various projects into it. One thing I noticed about the white-paper, there is this section shown as the SvnServe.conf file:

[general]
# anon-access = read
auth-access = write
auth-access = read

I (think) write access is inclusive of read. I know that if you do something like change the order so read is first that you won't be able to commit your changes (so I think it probably should just be removed in that case). ex.

[general]
#anon-access = read
auth-access = write

Another thing completely unrelated - there is something odd with the CAPTCHA here; it has failed for me the first time I attempted to post a new comment (and the second time around I'm sure I had it correct).

Steve from Pleasant Hill
August 08, 2007

# re: Setting up and running Subversion and Tortoise SVN

Paul -- I think that's the 'normal' Captcha behavior. I think Rick may be running this server on minimal memory and thus by the time you get done typing, Cache has purged the image.

Tom Opgenorth
August 08, 2007

# re: Setting up and running Subversion and Tortoise SVN

A quick way to get up and running with Subversion is to use the VMWare applicance : http://www.young-technologies.com/Software/Subversion-Virtual-Machine/. It's pretty much all configured for you: Just change the svnadmin password, create your respository, and away you go.

It's running Ubunutu 6.06 and SVN 1.3.3, but it's pretty easy to upgrade to the latest Ubunutu and Subversion.

Rick Strahl
August 08, 2007

# re: Setting up and running Subversion and Tortoise SVN

@Paul - thanks for the catch on the Read access. I actually had that in there for testing and forgot to remove it. Definitely only need the Read access. Fixed.

@Steve - re: VSS mind melt. I can relate. I have been using Vault for quite some time and have been happy with it (and Vault actually also supports Copy/Merge style SCC), but after trying Subversion for a while I find the Explorer style checkin/checkout much easier to deal with. The thing is with Subversion I end up putting almost EVERYTHING under source control almost automatically because it's quick and easy even if there are cross dependencies.

@JM - I talk briefly about Visual SVN in the article.

@Tom - Great idea to a use VM for this in any case and also possibly an easy way to deal with the Apache Http setup <s>.

@Paul - Captcha. My server is still having major issues with worker processes crashing frequently which blows away the cache so I'm guessing that's what you're seeing here.

Teemu
August 10, 2007

# re: Setting up and running Subversion and Tortoise SVN

I also use TortoiseSVN with Subversion and have found it more than adequate and flexible for my needs. I also had issues with Ankh.

Thanks for posting the article, it's a handy reference.

Teemu

Anonymous
August 12, 2007

# re: Setting up and running Subversion and Tortoise SVN

Rick, you finally ended up with an open source stuff!! that's great!! I am using TortoiseSVN and Subversion since from last 3 years and I never got into any issues. It really works well. I am using this where thousands of committs and thousands of check-outs in day with 50 member team for a big project. It really works well.

Simplicio Jison Jr.
August 18, 2007

# Subversion and Foxpro with lower and upper File Extension

Hi rick,
Have you experience working with Subversion and Foxpro and a filename extension problem? I notice fox save form srandomly with Upper or lower case in which subversion store them as different file.

Hope you can share how to fix that problem.

regards,
Simplicio Jison

Rick Strahl
August 26, 2007

# re: Setting up and running Subversion and Tortoise SVN

Hi Simplicio - unfortunately no. I haven't run into that particular problem but then I don't use forms/class libs too much and this doesn't appear to be happening with PRG files.

This is one annoying issue in VFP for sure - I've had issues with this in some other places as well...

Anybody know if Subversion can be made to be case insensitive when dealing with file names?

Toni M. Feltman
August 27, 2007

# re: Setting up and running Subversion and Tortoise SVN

I just figured out this morning what causes this. If you modify a file from the command window by typing in the name (MODIFY COMMAND Test.prg), when you save the file, FoxPro writes the file using the case from the MODIFY command, overwriting the case already on disk. If you modify using MODIFY COMMAND ? or opening through the project manager, this does not happen.

Rick Strahl
August 28, 2007

# re: Setting up and running Subversion and Tortoise SVN

@Toni - wow you know I never actually noticed this. I must be good about my lowercasing of things, because I haven't run into this issue with Subversion and my PRGs. Looking at some folders though I notice that extensions are all upper case. Probably using ForceExt()...

Same issue with VCX/SCX I suppose if you open from the command window (or MRU).

Robbe Morris
September 02, 2007

# Anti-virus software

Personally, I have always hated Subversion. I have had all sorts of problems moving files and directories around. That said, I can usually resolve them "eventually". Probably the biggest negative I discovered was watching anti-virus software constantly scanning the files subversion creates and accesses. This compounds the problem of anti-virus software scanning all of the .net files accessed by visual studio.

I do like the explorer interface versus the visual studio integration though.

Rick Strahl
September 02, 2007

# re: Setting up and running Subversion and Tortoise SVN

@Robbe - Hmmm... what do you use instead that doesn't have problems with moving files around? Moving files around with something that's hooked into VS SCC is a REAL bitch. With Subversion you can move things and the repository information moves with the files. It's super easy and it's easy enough to pull down the data again if you really move to a completely different setup.

As to AV - that's an issue for over-aggressive AV in general. You should be able to set it up to ignore your repository folder.

Robbe Morris
September 03, 2007

# re: Setting up and running Subversion and Tortoise SVN

I've never run into this issue with Team Foundation Server. I don't doubt that it is an issue for some folks but I've never had a problem with it. In contrast, I've never been able to do anything but blow away the folder on the server in Subversion (after first making a copy elsewhere of the local folder) and then checking the local folder back in.

I don't doubt that this may be a lack of training regarding Subversion on my part. The other thing I don't like is the hassle of not being able to place files in the same folder structure that I may not want in source control. Subversion automatically assumes it should be and adjusts my icons accordingly.

I think you'll find a lot of corporations lock down their anti-virus to prevent developers for ignoring the folders their source code sits in.

I've watched Norton, McAffee, Avast, and Trend just plug away at scanning the local copies of files made or accessed by subversion.

I could live with the headaches of subversion if it weren't for the negative performance penalties of anti-virus software. Which, in my opinion, is problematic for Visual Studio itself.

stm
September 05, 2007

# re: Setting up and running Subversion and Tortoise SVN

"Before doing anything else I suggest that you make one small configuration change in Tortoise SVN, changing the name of the local svn repositories from .svn to _svn."

In my experience this step is not necessary and cause no problems.
".svn" is a valid folder name (only windows explorer thinks is not)

You can create a folder name starting with period in command promt, in the vs solution explorer :), with a 3rd party file manager...

Would you share with us what is the exact problem with ".startwithperiod" folder name in vs?

Rick Strahl
September 05, 2007

# re: Setting up and running Subversion and Tortoise SVN

There are issues with Web Projects in Visual Studio. The problem is described here:

http://tinyurl.com/2wfddp

Windows Explorer in general is not happy with anything that starts with a period. Better safe than sorry. <s>

stm
September 05, 2007

# re: Setting up and running Subversion and Tortoise SVN

Thanks for the link.

Ok, I've just realized that I read that sometime (in tortoise manual or tortoies's web site), sorry I forgot.

(Note that this is an old and only vs 2003 problem. ".svn" cause no problem in vs 2005 version for me, maybe because the wap model not needs iis anymore)

Great intro article anyway, thanks!

Rick Strahl
September 05, 2007

# re: Setting up and running Subversion and Tortoise SVN

To be honest I've never run into this issue, I've just always taken this advice. It's a smal thing to setup/fix so there's little lost in the process.

JRR
March 23, 2008

# re: Setting up and running Subversion and Tortoise SVN

I'm doing some testing with VisualSVN and I'm wondering how people are handling solutions with multiple projects. Specifically, I have some class library projects that I might use in several different solutions. Any suggestions would be appreciated.

Zubeyir
September 28, 2009

# re: Setting up and running Subversion and Tortoise SVN

Hi

"Adding Projects and Files to Source Control" can be made through Ankh tool. What I found so far is it can add all the files of a project recursively to a repository.

Thanks for the great article BTW!

Bob
November 12, 2009

# re: Setting up and running Subversion and Tortoise SVN

I can see you have satisfied readers, so I must be close to getting this right. But I fell down at the same place I did in the SVN help files, which is why I came looking for more help.

My example -

My orriginal C# project is, lets say
C:\Projects\mathprog
I created the subversion folder as you describe, but here -
F:\svnsubversion
Then group folder
F:\svnsubversion\maths
and finaly the project folder
F:\svnsubversion\maths\mathprog
All added with the repro then committed and have a green tick to prove it.

In your text it is this -



But don’t just start importing ...

· Select one of the project folders and basically follow that same routine:
· Go into Tortoise and browse to your repository.
· Create a folder with the project name below the SummaLp folder (SummaLpManager)
· Go into Explorer and CheckOut into the corresponding folder

//This part is where things go wrong.
//the URL of Repository: is file:///F:/svnrepository/math/mathprog
//checkout directory: is C:\Projects\mathprog
//Message:- the folder isn't empty: but it is pointing at my project and I don't want that to //empty
//(Well, not the second time, ok so first time I didn't look properly and just clicked 'yes')
//So I change:-
//The checkout directory to: file:///F:/svnrepository/math/mathprog
//that isn't empty either, but maybe it always tells me that.
//It over writes, once, there after it tells me it 'doesn't exist' while at the same time still being there. (A Zen thing).

//So I wiped out the svn and recovered my project again to make sure no svn files were hiding anywhere, started from scratch, and still that part is where it goes wrong -
1. Url of repository
2. Checkout Directory.

In your example you suddenly stop showing the dialog with your example lines in it, which is what the SVN help files do too.


· This puts the project folder under source control
· Select files and folders, right click and add

I'm sure it is me that has got something wrong, I'm not blaming your post, but I can't get as far as putting even one file in my repository. I don't get that File Copy that you get, the repository is just empty.

Can you fill in the gaps for me please.

PS: My main reason for using SVN is because I've had enough of VStudio express crashing and then can not edit the files, or the xml is corrupt so I lose the designer. I can use the backups, but VS Express always waits till late in the day before it crashes.

E
December 09, 2010

# re: Setting up and running Subversion and Tortoise SVN

AnhkSVN doesn't support VS Express

Juancho Talarga
December 16, 2010

# re: Setting up and running Subversion and Tortoise SVN

I've read that Subversion has no integration with IIS. Is that true ? There is no way to publish a repository via IIS 6.0 and Windows?

Rick Strahl
December 16, 2010

# re: Setting up and running Subversion and Tortoise SVN

Subversion runs on Apache. There's a commercial adaption that runs on IIS but it's pricey. RocketSVN from AxoSoft if I recall right...

Mattia
February 18, 2014

# re: Setting up and running Subversion and Tortoise SVN

Hi,
I've been trying to configure a svn server in my lab following the steps reported in this really well explained guide. but I found problems while setting up to run Subversion as a Service. When I run the batch file with the reported code (paths of installation and repository are ok) I get the message:

[SC] CreateService FAILED 1073: the service already exist

and if I try to start the service I get a timeout error.
maybe it's of easy solving, but I'm new at server configuration. A bit of background: the server will have to run on a pc mounting Windows XP (32 bit), and all the access will have to pass through the proxy of the building. Before following your guide, I tryied to use VisualSvn Server but there were problems accessing it from remote using tortoise (impossible to create the SSL tunnel). So the VisualSvn program has been unistalled, the repository eliminated and new repository created during following your procedure.

Thank you for your help,
Mattia

West Wind  © Rick Strahl, West Wind Technologies, 2005 - 2024