Subversion and TortoiseSVN tips and tricks

Here is a list of Subversion and TortoiseSVN tips that I found and want to keep for future reference

  • Think hard if you need ASP.NET hack. If anyone in your company uses NET1.1 ASP.NET project, you do need it.
  • Instead of a checkout you can copy _svn/.svn folder to another folder and do an "update".
    • create a secondary work folder by copying the root _svn/.svn folder and do an "update".
  • You can "disconnect" from Subversion folder by deleting all _svn/.svn folders in several ways:
  • Don't rename/move files in Windows Explorer (or in Visual Studio or any other IDE), use TortoiseSVN's "rename" command or drag file/folder with right mouse button to get move/rename commands.
    • If you move a folder you move _svn/.svn folder with it. Doing that you are messing with working folder structure and are definitely going to get in trouble!
    • Another way of moving/renaming items is directly in Repository Browser. Use with care, though, since you are working without a safety net!
    • Intelligent IDE add-ins like VisualSVN also know how to rename/move.
  • There is no "destroy" command in SVN. Once in repository, always in repository.
  • If you want to undo a commit, you are probably looking for "Revert changes from this revision" or "Update item to this revision" command for more commits. Be sure to learn more before use.
  • If you really mess things up with your commit but you have correct code in unknown svn state, you should:
    • backup your working copy,
    • get another fresh, unchanged working copy,
    • delete _svn/.svn folder from your working copy,
    • copy all files over clean working copy.
    • Result is a working base with latest revision number but correct/old code. You can do "diff" or "commit", depends of what did you mess up in the first place.
  • "Clean Up" command is safe and  will not delete your changes. When TortoiseSVN says you should do a cleanup, do it.
  • You can create and apply patch files. Very useful for working copies that are far away.
  • You can issue a commit on any folder, not just root.
  • By default, you cannot change a commit comment. But your Subversion admin can. Don't turn this on, instead assign minimum comment length property (tsvn:logminsize) on every project root.
  • You can show some Subversion info about files in Windows Explorer in Detail View. I recommend turning on status and revision number columns. Unfortunately, this is broken in Vista.
    • you can sort files by status or revision number (or any other property/column) by clicking on oh header. Supper useful in folder with lots of files
  • Learn how to use svn.exe command line client. Sometimes it's easier/faster to do "svn update" than clicking.
    • "svn.exe" is in /bin folder of your subversion server install. Copy whole folder to development machine and put it in path.
    • svn status is also very handy and fast. It will show you add/modified/deleted/missing files and folders.
    • svn commit is not very handy, but it's incredibly geeky. You specify commit message using -m parameter or you need to set SVN_EDITOR environment variable that specify notepad or other editor that 
    • svn update is usually faster than right clicking if you are already in command prompt executing build scripts, for example.

source: http://vidmar.net/weblog/archive/2007/12/11/subversion-and-tortoisesvn-tips-and-tricks.aspx

 

Subversion Hosting

I saw the light and switched from SourceSafe in 2006 to Subversion.  Since it's so cheap and to benefit for off-site storage, I have paid for SVN hosting.  I recently changed hosts to ProjectLocker and couldn't believe how smooth the transition was.  At my prior host, in addition to hosting my subversion repository, I had a trac project.  Trac is really cool!  I downloaded dumps of my svn and trac databases and uploaded them to my new host.  Bingo-bango I'm online at a new URL but everything is the same!  ProjectLocker appears to be pretty solid and so far support has been good.   I've used Team Foundation Server for about a year and wasn't happy with that.  I'm thrilled with subversion and look forward to filling up my repo with some great code.

Some tools I recommend are VisualSVN if you like integration with visual studio.  It's cheap and gives you VSS/TFS like support.  I also use TortoiseSVN to manage my repository.  If you're interested in using Subversion, check out this link or this link.

Where is Bookpool.com?

I've shopped at Bookpool.com since 1999 and have purchased at least a book every other month or so since then.  I went to buy a new book a couple weeks ago and noticed a network solutions graphic.  I feared they were out of business.  Doing a google search I found a message board where somebody says they were in the process of closing down.  They had the best deals around, at least a percent or two cheaper than Amazon.com.

On another note, while at DevConnections two weeks ago, did my part to support the independant bookseller and bought another book from DigitalGuru.com who again had set up shop at the show.  I will do my best to buy a book or two again from him in the future.