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