Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Solution to adding a Git (TortoiseGit) toolbar to Visual Studio [closed]

Anyone know how to create a toolbar in Visual Studio 2010 to use with Git (TortoiseGit)?

Thanks

SurfRat

like image 441
SurfRat Avatar asked May 29 '11 19:05

SurfRat


People also ask

Do I need to install Git before TortoiseGit?

As a command-line git client is required for using TortoiseGit, you have to install both. The recommended order is to install TortoiseGit first. Just download the setup package for your system and install it. If you want a localized interface of TortoiseGit, also download a language pack and install it.

Where are TortoiseGit settings stored?

The settings appear to all be stored in the Registry rather than file configs. If you look under Computer\HKEY_CURRENT_USER\Software\TortoiseGit you will find a number of ContextMenuEntries keys which I believe control the context menu settings.

What is Git EXE path TortoiseGit?

14.0 of TortoiseGit, which is the latest. The TortoiseGit Git.exe Path setting currently points to C:\Program Files\Git\cmd .


1 Answers

enter image description here

I wanted a Git toolbar in Visual Studio and I found no solution to this so I thought I would share this with you.

I installed the Git Source Control Provider and got Git working (via TortoiseGit) with the right click context menu. This was tedious and rather ugly as all the TortoiseGit commands had the same icon.

I then added external tools to Visual Studio...

enter image description here

enter image description here

The external tool commands for TortoiseGit are as follows:

Title: Git Push
Command: C:\Program Files\TortoiseGit\bin\TortoiseProc.exe
Arguments: /path:"$(SolutionDir)" /command:push

Title: Git Commit
Command: C:\Program Files\TortoiseGit\bin\TortoiseProc.exe
Arguments: /path:"$(SolutionDir)" /command:Commit

Title: Git Sync
Command: C:\Program Files\TortoiseGit\bin\TortoiseProc.exe
Arguments: /path:"$(SolutionDir)" /command:Sync

Title: Git Revert
Command: C:\Program Files\TortoiseGit\bin\TortoiseProc.exe
Arguments: /path:"$(SolutionDir)" /command:Revert

Title: Git Log
Command: C:\Program Files\TortoiseGit\bin\TortoiseProc.exe
Arguments: /path:"$(SolutionDir)" /command:Log

Once the external commands were created I created my toolbar. Visual Studio 2010 out of the box will not allow you to have an image in your toolbar so I installed the Command Image Changing Extension.

Here are the icons I created enter image description hereenter image description hereenter image description hereenter image description hereenter image description here

The end result is a toolbar with the commands (showing only icons) that I need.

Update for Visual Studio 2012

The commands have changed slightly and are as follows:

Title: Git Commit
Command: C:\Program Files\TortoiseGit\bin\TortoiseGitProc.exe
Arguments: /path:"$(SolutionDir)" /command:commit

Title: Git Push
Command: C:\Program Files\TortoiseGit\bin\TortoiseGitProc.exe
Arguments: /path:"$(SolutionDir)" /command:push

Title: Git Sync
Command: C:\Program Files\TortoiseGit\bin\TortoiseGitProc.exe
Arguments: /path:"$(SolutionDir)" /command:sync

Title: Git Compare
Command: C:\Program Files\TortoiseGit\bin\TortoiseGitProc.exe
Arguments:  /path:"$(ItemPath)" /command:diff

Title: Git Revert
Command: C:\Program Files\TortoiseGit\bin\TortoiseGitProc.exe
Arguments: /path:"$(SolutionDir)" /command:revert

Title: Git Log
Command: C:\Program Files\TortoiseGit\bin\TortoiseGitProc.exe
Arguments: /path:"$(SolutionDir)" /command:log
like image 177
SurfRat Avatar answered Oct 01 '22 05:10

SurfRat