TortoiseSVN in Visual Studio

Update October 2 2007: Someone posted a link to Gary’s Bit Patterns where there is a settings file you can just import instead of doing all these manual steps.

I also fixed the quotes in the commands so they shouldn’t cause trouble anymore.


Ever wanted to use TortoiseSVN from VisualStudio? Well, now you can! 1

Contents

  1. Introduction
  2. Menu
  3. Toolbar
  4. Icons
  5. Done

Introduction

I have created a toolbar with Update, Log, Check, Revert, and Commit tortoise toolbar. The commands work the same as if you right clicked the folder containing the solution. Follow the steps below to get your own tortoise toolbar.

Menu

Select Tools > External Tools… from the Visual Studio menu. Add a tool using the following info.

adding tortoise to the menu

Field Value
#1  
Title Tortoise &Update
Command C:Program FilesTortoiseSVNbinTortoiseProc.exe
Arguments /command:update /path:"$(SolutionDir)" /notempfile
#2  
Title Tortoise &Log
Command C:Program FilesTortoiseSVNbinTortoiseProc.exe
Arguments /command:log /path:"$(SolutionDir)" /notempfile
#3  
Title Tortoise Check for &Modifications
Command C:Program FilesTortoiseSVNbinTortoiseProc.exe
Arguments /command:repostatus /path:"$(SolutionDir)" /notempfile
#4  
Title Tortoise Re&vert
Command C:Program FilesTortoiseSVNbinTortoiseProc.exe
Arguments /command:revert /path:"$(SolutionDir)" /notempfile
#5  
Title Tortoise &Commit
Command C:Program FilesTortoiseSVNbinTortoiseProc.exe
Arguments /command:commit /path:"$(SolutionDir)" /notempfile
  • $(SolutionDir) is the path to the directory the solution is in
  • /notempfile is required when running from the command line
  • The ampersands make that letter a shortcut for use in the menu

You should have the commands in your tools menu. Try them out and make sure they all work.

tools menu with tortoise commands

Toolbar

Add the toolbar by right-clicking your toolbar and select customize. Make a new toolbar and call it Tortoise. Close the customize window and right-click again, this time adding the tortoise toolbar.

Now go back to customize, select the commands tab, and scroll down to the tools category. You should see a bunch of commands like External Command 1, External Command 2, etc. Drag those on to your new toolbar. This may require some trial and error.

You can rename the commands in the toolbar by selecting a button with the customize window open, then clicking the Modify Selection button, then Name:.

changing the toolbar names

Icons

Now to add the icons. I haven’t found an easy way to do this yet. Here’s what I did:

Go to http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk/src/Resources/ (user guest, blank password). Browse to the image you want then right click the image and select Copy Image (note: this was on Firefox). With the customize window open right click the button and select Paste Button Image.

The pasted image won’t be transparent, so you need to edit the image. Right-click and select Edit Button Image. Then erase all the black area.

erasing the transparent part of the icons

Done

Your toolbar should look something like this: tortoise toolbar


  1. Well, you could have before if you wanted. I’m sure I’m not the first to come up with this. I know a few people already do this because it came up on the TortoiseSVN mailing list a while back.

kick it on DotNetKicks.com

Posted in Software Development and tagged . Permalink.

36 Responses to TortoiseSVN in Visual Studio

  1. Pingback: Ayende @ Blog

  2. Pingback: Kristopher Cargile

  3. Pingback: DotNetKicks.com

  4. Pingback: RJ Dudley

  5. The server was down overnight due to some maintenance replacing a UPS. After the replacement I forgot to turn the box back on. Anyway, it’s back up now.

    Sorry about the downtime.

  6. or you could use this addin that works kind of like SourceSafe. http://ankhsvn.tigris.org/

  7. Yeah, I used ankhsvn a while ago (over a year ago now). It had enough quirks back then that I stopped using it. I’ll give ankh another try once it reaches 1.0.

    Plus, I just love Tortoise. It’s a very high quality project with frequent updates and improvements. Even the nightly releases I’ve tried are amazingly stable and usable.

  8. Pingback: Desarrollo .NET

  9. I have a tip. If you follow the link to the TortoiseSVN repository on Tigris to get the icons, you will get the latest icons. If you have an earlier version of the program the icons might be different. But you can find the icons for your version in the tags folder of the repository.

    Also, Visual Studio 2005 could help by naming the external commands in the commands tab for toolbar customization (instead of external command 1 to 25).

    Michiel
  10. Pingback: Khurram Aziz

  11. Great! I did it in MS Visual Studio 2003.
    A little modification in external commands:

    Title Tortoise &Update
    Command C:Program FilesTortoiseSVNbinTortoiseProc.exe
    Arguments /command:update /path:”$(SolutionDir)” /notempfile

    I should removed the quotation marks to make the commands to execute:

    Arguments /command:update /path:$(SolutionDir) /notempfile

  12. sir here i want to use tortoise as a client and cvs as server …and i need to communicate through the asp.net application to client and server
    give me the code../API to communicate server and client

  13. I am interested in reading your article, but I have a problem viewing this site.
    The menu type area on the left is covering up the left side of the article.
    The maroon “menu” box is inside the gray “article contents” box. I am using IE 6.0.2900.2180.

    Anonymous
  14. Sunil: Sir, use TortoiseCVS instead TortoiseSVN, that is your code

  15. Regarding jwalker’s comment above: The quotation marks are indeed necessary if your solution path contains spaces. The problem is that when copying/pasting the commands in the blog post, the quotation marks are not in the correct format. Simply replace them with the standard quotation marks.

  16. How to get lock, release lock for a file using SVN in Visual Studio 2005

    Bich Nhung
  17. Pingback: Escuchoyo : Clientes SVN intengrados con Visual Studio 2008

  18. Pingback: Escuchoyo : Clientes SVN intengrados con Visual Studio 2008

  19. Pingback: Subversion y Visual Studio con Tortoise at Desert Zarzamora

  20. Great website and a very nice work you have done here.
    You can visit my website at http://nitin.sharma.nt.googlepages.com
    Here you can learn about Visual Studio in detail
    and also learn to make ASP.NET websites and windows applications using
    Visual Studio.

    Learn Visual Studio

  21. I can’t open a solution in visual studio from tortoise (repository)
    please help me!!!!!!!

    Sachin
  22. Pingback: TortoiseSVN w Visual Studio « ksciana’s Weblog

  23. Did anyone attend PDC last week?

  24. it’s nice post, specially newbie like me,

  25. Oh hell yeah… no graphical smilies around here.,

  26. what gives you that idea?,

  27. great tips. I enjoyed reading this,

  28. For checking the Remote modifictions too without needing to click on Check Repository what we need to do?
    I tried many versions usine remote
    using remote:”Repository path”
    I tried passing userIs aqnd paasord too through -u and -p, nothing worked.
    Is it even possible to do? and How?

    Title Tortoise Check for &Modifications
    Command C:Program FilesTortoiseSVNbinTortoiseProc.exe
    Arguments /command:repostatus /path:”$(SolutionDir)” /notempfile

    abhishek manocha
  29. thanx jon

    Anonymous
  30. I does not work for me in Visual C++ 2010 Express – I succeeded getting the toolbar and the external commands themselves, but somehow I can’t set any icons. Does anyone know a solution for this?

    Thanks in advance!

    Markus

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>