vscode: "Git: Failed to execute git" dialog but git works in terminal

Issue Type: Bug

As of approximately August, git integration no longer works, but git commands work fine from the terminal within VS Code.

I can reliably reproduce by opening a project folder with .git repository, clicking on source control tab in sidebar and pressing “Refresh” icon. VS Code then presents a dialog with “Git: Failed to execute git”. From there, opening the git log shows a normal log, with a series of commands and no errors:

Looking for git in: C:\Program Files\Git\cmd\git.exe
Using git  from C:\Program Files\Git\cmd\git.exe
> git rev-parse --show-toplevel
> git config --get commit.template
Open repository: \.
> git status -z -u
> git rev-parse --show-toplevel
> git rev-parse --show-toplevel
> git rev-parse --show-toplevel

...the log shows periodic calls to the following two commands from then on:
> git status -z -u
> git rev-parse --show-toplevel

user.email and user.name are already set globally so this solution is not a problem.

Issue occurs on insider edition of VS code and it also occurs when running as administrator and when running with --disable-extensions.

VS Code version: Code 1.27.2 (f46c4c469d6e6d8c46f268d1553c5dc4b475840f, 2018-09-12T16:17:45.060Z) OS version: Windows_NT x64 6.1.7601

System Info
Item Value
CPUs Intel® Core™ i7-4810MQ CPU @ 2.80GHz (8 x 2793)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: enabled
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
Memory (System) 15.63GB (7.97GB free)
Process Argv C:\Users\IBM_ADMIN\AppData\Local\Programs\Microsoft VS Code\Code.exe
Screen Reader no
VM 0%
Extensions (3)
Extension Author (truncated) Version
jshint dba 0.10.20
php-debug fel 1.12.5
printcode nob 2.3.1

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 21 (5 by maintainers)

Most upvoted comments

Joao, looks like we posted at the same time (see my comment above)… strangely a Windows system update solved the problem. To answer your last question though, all repositories were affected and they were in the local file system. So there is a strange dependency on some aspect of the OS. I’m going to close this issue.

Also would add that --verbose gave no clue on problems. I think we just need to get at exactly what is failing in the git call… I believe this is an edge case related to something about my workstation’s configuration - environment, path, permissions. I am suspicious that VSCode is internally executing git in a way that is not the same as is happening in terminal.