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 is not found #87102

Closed
PeterFromSweden opened this issue Dec 16, 2019 · 19 comments
Closed

Git is not found #87102

PeterFromSweden opened this issue Dec 16, 2019 · 19 comments
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@PeterFromSweden
Copy link

VSCode-no-git
Issue Type: Bug

Install VS Code
Open source control.

VS Code version: Code 1.41.0 (9579eda, 2019-12-11T18:37:42.077Z)
OS version: Windows_NT x64 6.1.7601

System Info
Item Value
CPUs Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz (8 x 3395)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off
surface_control: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.96GB (9.16GB free)
Process Argv
Screen Reader no
VM 36%
Extensions: none
@dbaeumer
Copy link
Member

Is the workspace you have opened under Git control ? The view is only populated if you open a folder which has a .git folder.

@divslinger
Copy link

Do you have the prettier extension installed? I have the same problem, disabling prettier solves it. Alternatively, waiting for 5 minutes helps too, it will eventually show up.

@joaomoreno
Copy link
Member

Can you run Git: Show Git Output?

@joaomoreno joaomoreno added the info-needed Issue requires more information from poster label Jan 14, 2020
@eine
Copy link

eine commented Jan 16, 2020

@joaomoreno, this is the output I see:

Looking for git in: C:\msys64\usr\bin\git.exe
Using git 2.24.1 from C:\msys64\usr\bin\git.exe
> git rev-parse --show-toplevel
> git rev-parse --git-dir
> git rev-parse --show-toplevel
> git rev-parse --git-dir

In a Terminal, git works as expected:

user@DESKTOP MINGW64 /t/vunit/vunit
# git version
git version 2.24.1

The relevant part of my settings:

    "git.path": "C:\\msys64\\usr\\bin\\git.exe",
    "terminal.integrated.shell.windows": "C:\\msys64\\usr\\bin\\bash.exe",
    "terminal.integrated.shellArgs.windows": ["-li"],
    "terminal.integrated.env.windows":
    {
        "MSYSTEM": "MINGW64",
        "CHERE_INVOKING": "1",
    },

@divslinger, disabling/uninstalling prettier and/or waiting does not have any effect.

@rhires
Copy link

rhires commented Jan 16, 2020

Is this related to #61491? For myself, I was also realizing that if I do a clone into a local folder, that {something} should git init the folder, too.

@eine
Copy link

eine commented Jan 16, 2020

I'm not sure about it. For me, exactly the same repos/folders that don't work on Windows, do work if I just run a container and attach VSCode to it. Note that it is the same filesystem and the same VSCode version. Hence, I don't think it has nothing to do with the content of the folders, but with VSCode's 'Source Control' feature being broken on Windows.

@joaomoreno
Copy link
Member

joaomoreno commented Jan 16, 2020

You seem to be using MSYS Git. Can you install Git for Windows instead? https://git-scm.com/ This is the only version we support.

@eine
Copy link

eine commented Jan 16, 2020

Unfortunately, I cannot. On some workstations I don't have admin permissions. Nevertheless, why would users install Git for Windows (which is a limited distribution) instead of using the one in MSYS2? I understand that MSYS2 can be a replacement for Git for Windows, but not the other way round.

Is it possible to hide the 'Source Control' tab when it is useless?

@joaomoreno
Copy link
Member

Sure, you can disable git with the git.enabled setting and hide the SCM view by right clicking it.

@eine
Copy link

eine commented Jan 16, 2020

Sure, you can disable git with the git.enabled setting and hide the SCM view by right clicking it.

I tried to do so. Unfortunately, that seems to be a global setting. As a result, when I attach to a container (where a supported git exists) I need to remember to enable it again. Is it possible to set a different behaviour when it is native vs attached?

Ideally, VSCode would detect if it can show any relevant content in Source Control, and disable it otherwise.

@joaomoreno
Copy link
Member

Unfortunately, that seems to be a global setting.

You can have workspace settings as well, would that work?

@eine
Copy link

eine commented Jan 16, 2020

Unfortunately, that seems to be a global setting.

You can have workspace settings as well, would that work?

The workspace/folder is the same in both contexts. So, I'm working on Windows and whenever I need a tool that is only available/supported on GNU/Linux, I run a container by sharing the root of my workspace/folder and opening it in the attached window. Then, I can work on the same project/sources with two views/windows of the same instance of VSCode: one on Windows with MSYS2 and another one in the container with the shell in it.

@joaomoreno
Copy link
Member

Do you use the Remote Containers extension for that?

@eine
Copy link

eine commented Jan 16, 2020

Do you use the Remote Containers extension for that?

Yes. By "attach" I mean using the "Remote - Containers" extension.

@joaomoreno
Copy link
Member

joaomoreno commented Jan 17, 2020

Got it. I still suggest to install Git for Windows, as mentioned above. Can you maybe talk to your sysadmin? You can also install the Portable version.

@bowdenk7
Copy link

You can set container specific settings to enable only in a container where a supported version of git is installed.

https://code.visualstudio.com/docs/remote/containers#_container-specific-settings

@eine
Copy link

eine commented Jan 21, 2020

@bowdenk7, containers are not created/started from VSCode, but externally. Hence, there is no devcontainer.json. Is it possible to set those options in the "regular" settings?

@joaomoreno, I'm ok with using containers if MSYS2 is not supported by VSCode. It just seems to me that the UX could be improved slightly. It is misleading that git works perfectly when MSYS2 is used as a Terminal in VSCode, and yet the message is "No source control providers registered". Something along "No supported source control providers found" would be easier to understand.

Ref #10281

@github-actions
Copy link

Hey @joaomoreno, this issue might need further attention.

@PeterFromSweden, you can help us out by closing this issue if the problem no longer exists, or adding more information.

@eine
Copy link

eine commented May 22, 2020

In case it was overlooked by others, the bat file in #4651 allows VSCode to partially support MSYS2's git. At least, changes are shown and "Source Control" tab is not empty.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

7 participants