Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git doesn't pick up user installation directories #40229

Closed
Tyriar opened this issue Dec 14, 2017 · 23 comments
Closed

Git doesn't pick up user installation directories #40229

Tyriar opened this issue Dec 14, 2017 · 23 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release git GIT issues important Issue identified as high-priority verified Verification succeeded

Comments

@Tyriar
Copy link
Member

Tyriar commented Dec 14, 2017

Reported in https://twitter.com/ArtVandelay440/status/941408422217601030

#32739 used to find git on the path. We should add the default user installation dir to the set of paths we search.

Might be a good candidate for recovery build?

@Tyriar Tyriar added git GIT issues important Issue identified as high-priority labels Dec 14, 2017
This was referenced Dec 15, 2017
@WallenHan
Copy link

WallenHan commented Dec 15, 2017

Hi, buddy! I find a way to reslove this.
when you config your git path , DO NOT use the windows style path ,llike this: D:\\DevelopTool\\Git\\bin\\git.exe
Should use linux style , D:/DevelopTool/Git/bin/git.exe.
maybe this will help someone! 😄

@liaoya
Copy link

liaoya commented Dec 15, 2017

@WallenHan D:\\DevelopTool\\Git\\bin\\git.exe style works for me on Windows 10 with VSCode 19.0

@WallenHan
Copy link

@liaoya I had tried this. but not work. Fortunately, the linux style works well。

@joaomoreno
Copy link
Member

Automatically launching git was disabled because of #32739.

Automatically launching Git from Github for Windows was disabled because of #35965.

We should add the default user installation dir to the set of paths we search.

@Tyriar I don't understand what you mean by that since the Git installer doesn't seem to have a user-only option. At least I could not find one.

Also, the latest version shows a popup, guiding the user of what to do, for those who did not install Git in its default path:

image


Nevertheless, we can experiment with using something like node-whereis to see if we find a git.exe somewhere in the user's PATH.

@LeopoldLerch
Copy link

LeopoldLerch commented Dec 15, 2017

The problem is, that the default setup for git, which is also reached by the "download Git" button in the error message, is installing git into the hidden appdata-folder of the users profile directory. There is no option to install it even optionally in the program folders (tried 3 times now, altough i had already installed (or because?))

So it would be nice if you would also include to search it automatically in the specific users folder (eg. %userprofile%\AppData\Local\Programs\Git\cmd)

because the error message currently does confuse. Currently the user (at least on win10) has to install git AND has to configure the git.path. Only installing it does not fix it.

EDIT:
Okay, it was BECAUSE it had already installed it. The current version installs into the program-folder by default. But I can´t imagine installing it into my profile in the past. Anyhow the user profile path should be added to the default-lookup too.

@joaomoreno
Copy link
Member

The problem is, that the default setup for git, which is also reached by the "download Git" button in the error message, is installing git into the hidden appdata-folder of the users profile directory.

@LeopoldLerch Totally agree. I couldn't get the same behaviour to happen on my machine... How does the setup propose that path to you?

@LeopoldLerch
Copy link

Well, when already installed, it does not . I uninstalled it, and then the usual path-picker for the installation path is displayed. Which is now preset to C:\Program Files.

Don´t know why it it was installed in my users-directory or how i managed it on a previous version. But I surely did not provide the path to my profile in a textbox. Maybe there was a default option to install it for all users or just me in the path.

@joaomoreno
Copy link
Member

Got it. Can you re-confirm that the path is indeed %userprofile%\AppData\Local\Programs\Git\cmd?

@LeopoldLerch
Copy link

LeopoldLerch commented Dec 15, 2017

it was at least previously. After uninstalling i had only the option to set the path, but it is now pretargeting the programs-folder. And now it works without setting git.path explicitly in vs-code.

@joaomoreno
Copy link
Member

joaomoreno commented Dec 15, 2017

OK pushed two changes:

  • Try to find Git in %LOCALAPPDATA%\Programs\Git
  • Try to find git.exe in the PATH (as opposed to blindly spawning git)

Verification

  • Code review: 9622ada
  • Install it in %LOCALAPPDATA%\Programs\Git and don't put it in the PATH
  • Install it in C:\Git, for example, and put it in the PATH

In both scenarios, VS Code should pick it up.


I'm promoting this issue to a recovery candidate build: 1.19.1.

@joaomoreno joaomoreno added the bug Issue identified by VS Code Team member as probable bug label Dec 15, 2017
@joaomoreno joaomoreno added this to the November Recovery 2017 milestone Dec 15, 2017
joaomoreno added a commit that referenced this issue Dec 15, 2017
@joaomoreno joaomoreno added the candidate Issue identified as probable candidate for fixing in the next release label Dec 15, 2017
@Vixb1122
Copy link

The problem is very serious. Please fix it as soon as possible.

@aiyogg
Copy link

aiyogg commented Dec 18, 2017

I also encountered this problem, add 'git.path' user setting to resolved temporarily.

@aeschli
Copy link
Contributor

aeschli commented Dec 18, 2017

I verified the steps from #40229 (comment)

@MACDfree
Copy link

MACDfree commented Dec 18, 2017

如果使用中文的Windows 10出现git.path明明配置了但还是报错找不到git的情况,请把配置的路径删了自己手打一遍,因为从资源文件属性中复制的路径可能存在编码问题,如下图:
image
image

@aeschli aeschli added the verified Verification succeeded label Dec 18, 2017
@david-russo
Copy link

david-russo commented Dec 19, 2017

For future reference: I believe Git defaults its install location to the local app. data folder when the user doesn't have the administrative rights to install to the system's program files.

@imhuay
Copy link
Contributor

imhuay commented Dec 20, 2017

Hope to change back. If use git.path to set git.exe. It means I can't use same config at different workspaces with some sync plug-in.

@db6edr
Copy link

db6edr commented Dec 20, 2017

This has already been fixed and might already be available in the insiders edition. It will be rolled out to stable with the next recovery release.

@JoeKahl
Copy link

JoeKahl commented Dec 20, 2017

Windows 7: my Git is installed here: C:\Users\jkahl1\AppData\Local\Programs\Git\cmd\git.exe
After taking the VSCode 1.19.0 update this morning I am blown out of the water!
How do I fix this? Help!

@JoeKahl
Copy link

JoeKahl commented Dec 20, 2017

Can I roll back my VS Code version?

@Tyriar
Copy link
Member Author

Tyriar commented Dec 20, 2017

@JoeKahl set the git.path setting to your local path to fix the issue until the recovery release is out.

@JoeKahl
Copy link

JoeKahl commented Dec 20, 2017

@Tyriar Thank you. Here is what worked for me.
I used VS Code to add an override in my user settings, File / Preferences / Settings :
"git.path": "C:\\Users\\uuuuuuu\\AppData\\Local\\Programs\\Git\\cmd\\git.exe"
Then I closed and opened VS Code and I am back in business.

The Warn message is actually quite good.
My additional challenge was that my VS Code experience is only a few months and today was my first time to configure preferences.

@db6edr
Copy link

db6edr commented Dec 21, 2017 via email

@ghost
Copy link

ghost commented Jan 27, 2018

Me having the same with GitHub portable version

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release git GIT issues important Issue identified as high-priority verified Verification succeeded
Projects
None yet
Development

No branches or pull requests