I have Windows10 with the Ubuntu bash and Visual Studio Code.
Every time I start Visual Studio Code it prompts a warning saying:
Git not found. Install it or configure it using the 'git.path' setting
I got git actually installed through the bash terminal:
# which git
/usr/bin/git
How can I instruct Visual Studio Code to use that git installed in the bash terminal?
I have tried through the git.path setting but I am not sure how to set the path to something that is relative to the bash terminal.
If you're running Visual Studio Code on Windows, you also need to install Git for Windows. VsCode currently can't access git on the linux subsystems.
Related
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.
I use Bash terminal on Windows. And I confused how can I run the Visual Studio solution from terminal?
For example
open the terminal
git clone https://github.com/somerepository.git
cd somerepository
*VISUAL-STUDIO* somerepository.sln
Just only.
What can I write instead of VISUAL-STUDIO
UPD.
I use "Git For Windows", its provides a BASH emulation.
Is there a way to use the git submodule add command in Visual Studio 2019 without installing any add-ons? I use the GitHub tools provided by VS2019 and I would like to use just that and the built-in command line, but it seems that only some specific Git commands are supported...
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.
I just followed the top-voted answer here and successfully installed Visual Studio Code's code command in my terminal.
However, the code command fails to launch Visual Studio Code every time after I restart my MacBook Pro.
~ code
zsh: command not found: code
Is it possible to install code permanently so that I don't have to install it every time I turn on my MacBook Pro?
~ where code
/usr/local/bin/code
~ ls -l /usr/local/bin/code
lrwxr-xr-x 1 myName admin 167 Aug 5 13:41 /usr/local/bin/code -> /private/var/folders/bh/525lnbns1213cx2651s97my00000gp/T/AppTranslocation/EA379FC4-05D2-4739-BE49-1D8870E47B8A/d/Visual Studio Code.app/Contents/Resources/app/bin/code
I also find out that the folder EA379FC4-05D2-4739-BE49-1D8870E47B8A get deleted after I restart my laptop.
This is the reason that I cannot run code after the laptop is restarted.
Why is code installed in a temporary folder?
My MacBook Pro's version is macOS Sierra version 10.12.6
The reason that code get installed in a temporary folder is that I placed Visual Studio Code.app in Downloads folder.
After I moved it to Applications folder, launched it, and installed code command, the code is not installed in a temporary folder anymore.
you can this code in visual studio code command palette to register shell command.
Open the command palette.
shell command
and run this command to install 'code' command
install 'code' command in PATH
And then restart terminal