Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Anyone know how to create a toolbar in Visual Studio 2010 to use with Git (TortoiseGit)?
Thanks
SurfRat
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...
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
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
Related
Git bash integrates well into VS Code but not Visual studio. In VS Code, it opens in the terminal tab but in Visual Studio (17.4.2), it opens as a separate window.
Is there a way I can get git bash to open as an integrated terminal, just like Developer Powershell?
I couldn't reproduce this problem. git-bash runs in the terminal tab as expected.
What I did:
From the menu choose Tools -> Options
In the Options dialog choose Environment -> Terminal
Add a new Profile with
Name: Git Bash
Shell Location: C:\Program Files\Git\bin\bash.exe
Arguments: -i -l
The terminal in Visual Studio is based on the Windows Terminal. I used the 'Git Bash' profile in Windows Terminal as the template for the profile in Visual Studio.
I am trying to developp a script to automate the installation of DFIR-ORC and Visual Studio. I already installed Visual Studio by command-line using the following:
.\vs_Community(1).exe --addProductLang En-us --add Microsoft.VisualStudio.Workload.NativeDesktop --includeRecommended --wait --quiet
Now I want to modify the configuration with .vsconfig from the dfir-orc repo. So I use the following commmand:
.\vs_Community(1).exe modify --installPath "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\" --config ".\vsconfig"
But I have an error saying: The 'env' option in unknown. If it can help, you'll find the content of the .vsconfig file here: https://github.com/DFIR-ORC/dfir-orc/blob/main/.vsconfig
Do you have any idea ?
Thanks !
I'm trying to compile the following project:
https://github.com/xoofx/markdig
In Visual Studio 2022, How to resolve the error message:
System.InvalidOperationException: "git" is not present in PATH.
What's the correctly way to install 'git' for visual studio? I thought Visual Studio Already has git installed out of the box, judging by the label "Git" on the menu bar.
Here's a picture of my screen:
Menu: Tools->Command-Line:
Thanks for adding the picture. You need to have git installed. This can be done independently or through visual studio installer.
https://git-scm.com/downloads
It will ask you during installation if you want it to be added to the path - choose yes.
Once you have installed, launch the command window from start menu
and run git command. That should show something like this -
[2]
Once you have git command running from command line it should work from visual studio as well. Essentially VS is trying to launch that command from its shell and failing to find it because you dont have git installed.
VS does come with git installed but you have to choose it in its workloads. You have to go through all available installation options. See the screenshot below from VS 2017 installation workload. You can do this by re-launching your VS installer and selecting the products that you want installed. Since I use most of the things, I dont uncheck anything but that takes close to 50Gig space on the disk - something you want to be aware of.
We've all seen this command sequence:
git clone [someRepo]
cd [someRepo]
code .
This will clone some repo, get into the folder and open it using Visual Studio Code. Without going into arguments whether VSCode or VS is better - I do use Visual Studio. Is there some VS command that is similar to "code .", that will open some solution directly from git bash/powershell/cmd?
Thanks in advance!
As an improvement of my first question you can use :
git clone [someRepo]
cd [someRepo]
start devenv .
It will open visual studio with the current directory.
I wan't to use Visual Studio 2017 (15.5) together with a Git repository which tracks some files with Git LFS.
I already have Git 2.15, which contains Git LFS, installed on the machine.
I've Visual Studio 2017 installed with only the following workloads and without the Git component since it already is available on the machine:
--add Microsoft.VisualStudio.Workload.ManagedDesktop
--add Microsoft.VisualStudio.Workload.NetWeb
--add Microsoft.VisualStudio.Workload.NetCoreTools
--add Microsoft.VisualStudio.Component.Wcf.Tooling
Visual Studio fails now to checkout branches from the repository since it cannot find Git LFS.
I assume this is because git-lfs.exe is not available on the path, and Visual Studio has its own Git instance in c:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\bin\.
If I additionally install the standalone git-lfs installer, which makes git-lfs available on the path, checkout works on some machines but not on other (haven't found out what's the difference, maybe installation order or if it was a new installation or update of Visual Studio).
If I remove the c:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\ folder everything works fine in Visual Studio, as it does use the Git version available from the path.
My questions are:
What is the supposed way to have Git LFS support in Visual Studio?
Is there a way to have Visual Studio using the Git Version on the path instead of installing its own instance
Does Visual Studio expect git-lfs on the path or should it also work with Git LFS installed through the bundled installer in recent versions of Git for Windows.
To get Git LFS working with Visual Studio 2017 (15.5.2) it requires Git LFS installed with the standalone Git-LFS installer. If Git LFS is installed with the Git for Windows distribution git-lfs.exe is not available on the PATH, and since Visual Studio has its own instance of Git, LFS functionality won't work.
It is also important to have Git LFS early in the path otherwise it won't be passed to Git by Visual Studio as the PATH passed to the Git instance run by Visual Studio is limited in the length. For example installing Git LFS after Visual Studio often ends with git-lfs.exe too late in the PATH.