Bite my bytes

What I learn by day I blog at night - A blog from Microsoft Consultant working from Ljubljana, Slovenia

  Home :: Contact :: Syndication  
  999 Posts :: 7691 Comments :: 235 Trackbacks


Most popular posts
in last 30 days


My Projects



Copyright © by David Vidmar
Contact me!
LinkedIn Profile

Here is a list of Subversion and TortoiseSVN tips and tricks I collected during adoption of Subversion in couple of development teams.

  • 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.


Feel free to post additions and corrections in the comments!


Related posts:

Links to software


Posted on Tuesday, December 11, 2007 10:32 PM | Filed under: Software Developement |


# Our daily link (2007/12/12) 12/12/2007 11:15 PM Trumpi's blog
Software Parallels CTP - please don't all rush at once to get this. Otherwise we'll have a race

# re: Subversion and TortoiseSVN tips and tricks 12/13/2007 10:40 AM Sandor Korozsi

I regularly use one feature, which was not listed here, so I share this tip, I hope it is useful for others too.

I use this for deploying changes to the staging server at hosting company. The connection is too slow to copy everything every time (takes hours, sometimes days to deploy one project through ftp connection)

I create an export from the changes between two revisions. (I store the last deployed revision number every time). In the log view, select the last revision, and the revision which was deployed last time. Right click, on one of the selected revisions, and then select Compare revisions. Select all the files listed, then Right click -> Export Selection to... And you have the file list, just have to copy (Ok, not just copy: you should delete *.cs, *.resx etc, and have to copy your /bin if you don’t store it in subversion). In addition, it is not there in the menu, but you can save your change log by selecting the files in this compare list, and press CTRL+C.


# re: Subversion and TortoiseSVN tips and tricks 12/13/2007 10:55 AM Sandor Korozsi
On Other tip: I use other .net projects (libraries which are used in lots of projects) as external libraries in the repository. It is useful when you want to debug them sometimes. An external library is redirected to another repository. When you update your main repository, external libraries are also updated, so you get the changes automatically after a bug fix, or change in the library.
You can do this like this:

In TortoiseSVN select Properties -> then add "svn:externals", then you can list your repositories and their location in your project file structure: lib/XXX.Language

There is a space between the directory and repository url. You can change the externals source too, and you can commit, but I don't recommend it mainly when it is a tag. ;)

# re: Subversion and TortoiseSVN tips and tricks 12/13/2007 9:11 PM David
Tnx for you tips, Sandor!

# links for 2008-02-11 2/11/2008 6:21 AM never-ever-****
Version Control with Subversion This is the online home of Version Control with Subversion, a free book about Subversion, a new version control system designed to supplant CVS. This book is published by O'Reilly Media. (tags: oreilly books subversion)...

# araba oyunları 8/26/2008 7:46 PM araba oyunları
tank you

# ehliyet 9/8/2008 6:28 PM olcay
ehliyet sitesi

# re: Subversion and TortoiseSVN tips and tricks 4/3/2009 9:58 PM araba oyunları
thank you admin

# re: Subversion and TortoiseSVN tips and tricks 6/14/2009 1:47 PM asm
also you could use this:

# re: Subversion and TortoiseSVN tips and tricks 10/11/2009 5:05 PM Forum
woows. Thanks !

# re: Subversion and TortoiseSVN tips and tricks 2/18/2010 2:21 PM araba oyunları
SELECT n.nid FROM node n LEFT JOIN term_node tn ON n.nid = tn.nid GROUP BY n.nid HAVING count(tn.tid) =

# re: Subversion and TortoiseSVN tips and tricks 3/29/2010 11:09 AM Lamia
Thanks! The section about disconnecting from SVN was very helpful!

# re: Subversion and TortoiseSVN tips and tricks 4/3/2010 6:10 PM Nagelstudio
Great stuff guys! I really don’t know how much time it takes for your guys to compile such a list of excellent resources but it takes a lot of time for me to digest it all! Keep up the good work! Thank you!

# re: Subversion and TortoiseSVN tips and tricks 5/8/2010 9:33 AM Soğutma Büyüsü
Thanks! The section about disconnecting from SVN was very helpful!

# re: Subversion and TortoiseSVN tips and tricks 2/22/2012 3:14 PM Gil
One of the most common mistakes using Tortoise-SVN is to move (or copy) versioned file (or folder) using mouse drag-and-drop with left mouse button, instead of right one – which is the right one ;-)

Do you know any plug-in/script that disables left mouse-button drag-and-drop functionality (or makes it similar to right mouse button) in folders that are subversion folders?

Comments have been closed on this topic.