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

SCM: Viewlet should improve "no repositories" messaging #61491

Closed
stevehurcombe opened this issue Oct 22, 2018 · 26 comments
Closed

SCM: Viewlet should improve "no repositories" messaging #61491

stevehurcombe opened this issue Oct 22, 2018 · 26 comments
Assignees
Labels
feature-request Request for new features or functionality on-testplan scm General SCM compound issues
Milestone

Comments

@stevehurcombe
Copy link

Issue Type: Bug

This is a new installation of VS Code and Git.
I've reviewed other issues and I have verified the following:

  1. Git can be found on the path. Git: Show Git Output displays:

Looking for git in: C:\Program Files\Git\cmd\git.exe
Looking for git in: C:\Program Files (x86)\Git\cmd\git.exe
Looking for git in: C:\Program Files\Git\cmd\git.exe
Looking for git in: d:\Program Files\Git\cmd\git.exe
Using git 2.19.1.windows.1 from d:\Program Files\Git\cmd\git.exe

  1. This is a brand new install of VS Code and a new install of Git.

  2. The extension is enabled (I did try disabling and reenabling), no luck.

  3. There are no icons on the source control pane, nor any ellipsis menus (...).

VS Code version: Code 1.28.2 (7f3ce96, 2018-10-17T00:23:51.859Z)
OS version: Windows_NT x64 10.0.17134

System Info
Item Value
CPUs Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz (8 x 3396)
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.96GB (4.15GB free)
Process Argv
Screen Reader no
VM 0%
Extensions: none
@stevehurcombe
Copy link
Author

Screenshot.
snap 2018-10-22 at 14 06 34

@vscodebot
Copy link

vscodebot bot commented Oct 22, 2018

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@vscodebot vscodebot bot added the git GIT issues label Oct 22, 2018
@joaomoreno
Copy link
Member

Did you open a git repository at all?

@joaomoreno joaomoreno added the info-needed Issue requires more information from poster label Oct 22, 2018
@stevehurcombe
Copy link
Author

stevehurcombe commented Oct 22, 2018

From within VS Code? No, there is no option to do that.

@stevehurcombe
Copy link
Author

I think this might just be a confusing message. I used the console to clone a repository and when I opened the folder in VS Code the source control pane worked as I expected it to. Once I closed the folder the same message reappeared. Coming from a Visual Studio & TFS world I was expecting a different experience.

IMHO the message should clarify that Git is installed and functioning, you just need to used the console to clone a repository and open it...at least that's how I think it should work. Time to watch a few videos!

@joaomoreno
Copy link
Member

Yup, I totally agree. You're not the first one to think that.

I'll rename this issue accordingly.

@joaomoreno joaomoreno added this to the Backlog milestone Oct 23, 2018
@joaomoreno joaomoreno added feature-request Request for new features or functionality scm General SCM compound issues and removed git GIT issues info-needed Issue requires more information from poster labels Oct 23, 2018
@joaomoreno joaomoreno modified the milestones: Backlog, November 2018 Oct 23, 2018
@joaomoreno joaomoreno changed the title No source control providers registered. SCM: Viewlet should improve "no repositories" messaging Oct 23, 2018
@pramodnitmz
Copy link

click on extension type @disabled you will see all disabled extension on of them will be git just enable(workstation)

@stevehurcombe
Copy link
Author

Thanks, I did that before posting. Have a look at my last comment. The widget gave the impression that it wasn't working, when it was.

@chrisweb
Copy link

Actually just had the exact same problem

I opened vscode and it said "No source control providers registered."

vscode_no_source_control

So I googled vscode git support and followed the documentation: https://code.visualstudio.com/docs/editor/versioncontrol#_git-support

So I intalled git for window and ensured git was in the path, then just to be sure I restarted my PC

I reopend vscode and still had the exact same message "No source control providers registered.", so I assumed the git installation or something related to vscode was wrong, so I googled again and found this ticket first: #61522

in that ticket someone has the exact same problem, one comment said to press CTRL+SHIFT+P and then enter "Git: Show Git Output", which gave me:

Looking for git in: C:\Program Files\Git\cmd\git.exe
Using git 2.19.1.windows.1 from C:\Program Files\Git\cmd\git.exe
> git rev-parse --show-toplevel
fatal: not a git repository (or any of the parent directories): .git

so I realised vscode was indeed finding git, but somehow was expecting me to already have a git repo opened and finally the next comment of that ticket had the suggested solution which consisted off manually creating a folder and do a manual git clone first,

So I went to the explorer opened a blank folder, then I opened a new vscode terminal panel, entered my git command, which opened the GitHub login window:

vscode_git_login_window

and after login in it successfully cloned my repository and I could use git as expected.

Next time I reopened vscode it had finally realized that git is installed and working and hence did not show the "No source control providers registered." message anymore

in the ticket #61522 it says to come to this ticket here to see if the git workflow could be improved, this is why I wrote this explanation

So in my opinion it would be great if after installing git, vscode would at least show another message, even better would be if there was a button that says checkout your first repo or login to your git service provider and open a login panel, you click it, enter your credentials or the repo url and bam you are done :)

@bvandenbon
Copy link

And that's also why I am here --> also confused about the "No source control providers registered".
I was just about to reinstall visual studio code, when I found this post. pfew :)

@ciscorucinski
Copy link

I don't know if there is a difference between some of the images posted above. For example, @chrisweb has the Git Logo on his sidebar. I have also seen the 3 horizontal dots on some images. However, my VS Code is just like @stevehurcombe where there is no Git logo and not 3 horizontal dots.

There are no actions for me to take from the UI to fix this issue. That's just bad UX

@bvandenbon
Copy link

I propose adding just a tiny bit more info.

No source control providers registered.
Possible fix: clone a git repository in a terminal window.

where clicking the word terminal, will indeed just open a terminal.

@ciscorucinski
Copy link

You know what people must do. They must clone a git repo. The set of commands to do that are very limited.

Why not just allow users to enter in a *.git location and automatically clone the repo?

@KokoDoko
Copy link

KokoDoko commented Mar 27, 2019

Has this issue been solved? I have suddenly been getting the No source control providers registered message when cloning an existing git repository.

When using Git: Show Git Output in VS Code I get:

Looking for git in: usr/local/bin/git
Using git 2.17.1 from usr/local/bin/git

My repository is cloned from GitHub and has a .gitignore file.
Older repositories that I cloned a few months ago still work with git!

When initialising a git repo I get this error:

Git: spawn usr/local/bin/git ENOENT

What can I do to get git working again in VS Code?

@joaomoreno
Copy link
Member

@KokoDoko Did you configure git.path? If so, you forgot the leading / in /usr/local/bin/git.

@prageeth
Copy link

prageeth commented Apr 8, 2019

SOLVED!!!

I just upgraded VS Code to the latest and had the same issue. What solved the issue? The solution posted by @pramodnitmz

For some reason, during the upgrade the "Git" extension was disabled. All i had to do was go the the "extensions", then type @disabled. It will show all disabled extensions, in my case, "Git". Enabling the extension solved my issue.

@jamiecon
Copy link

See https://stackoverflow.com/questions/46609255/git-missing-in-vs-code-no-source-control-providers for a sample of some confusion caused by this message.

@rhires
Copy link

rhires commented Nov 11, 2019

Just got moved to a new machine at work, and this issue popped up. I agree with someone who said that the message should say "Git is installed/working (whatever), but you're not in a git enabled repository. Would you like to create a new one or open a folder that has one?" well, that's the gist of it, anyway. And then those two options should be available for the user to act on...

@SnoopyGeeek
Copy link

Hi, I solve this problem by changing the order of environment variables paths. Specifically, I move my desired searching scope of git upper and the problem just went away once I did so.

@rainabba
Copy link

rainabba commented Nov 26, 2019

Fresh install of VSCode and Git on a brand new Windows 10 machine and despite git working in Terminal, PowerShell and WSL, AND the GitLab flow extension working, Source Control still reports "No source control providers registered". I've also tried after removing GitLab Flow and restarting just in case.

GitLens extension is working as expected as well.

I have no disabled extensions. Authentication is working fine (I can use any of my terminals to successfully fetch). SmartGit works as expected when fired up (the point is to not have to though).

Version: 1.40.2 (system setup)
Commit: f359dd6
Date: 2019-11-25T14:54:45.096Z
Electron: 6.1.5
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Windows_NT x64 10.0.18362
Git: 2.17.1 (WSL), 2.24.0.windows.2 (Windows)

@rainabba
Copy link

rainabba commented Nov 26, 2019

As I'm now seeing "fatal: not a git repository (or any of the parent directories)", I wonder if it has nothing to do with Git or our projects, just the context the commands are run in.

Using git 2.24.0.windows.2 from C:\Program Files\Git\cmd\git.exe
> git rev-parse --show-toplevel
fatal: not a git repository (or any of the parent directories): .git

@bowdenk7
Copy link

Right now unless you are in a folder with an active source control provider, you get the following:
alt text

I think we should be able to provide a little more direction. A user can be in a few different states when they're looking at this message:

  • you want to use git
    • git is not installed
    • git is installed
      • not in a folder
      • in a folder without an initialized repo
  • you want to use other version control (we'll call this svn/etc)
    • svn/etc is not installed
    • svn/etc is installed
      • extension is not installed

Proposal

First we detect whether there is a working git installation:

If we don't detect git installation - show instructions on how/where to install git and a note about how to use other scm providers
alt text
Links:

if we do detect a git installation - we assume you want to use git

  • if there isn't a folder open - instruct the user to open a folder to get started (or clone a repository from GitHub?)

alt text

Clone from GitHub would trigger the existing Git: Clone command

  • if there is a folder open with no .git folder - provide the option to git init for the user

alt text

@rhires
Copy link

rhires commented Jan 17, 2020

@bowdenk7 - I think you should just copy/paste what you wrote as a new request, because it's about much more than messaging. And this is a fantastic proposal!

@joaomoreno
Copy link
Member

@bowdenk7 Since #89080 has landed, I have adopted it in Git. We now cover the following cases:

Git extension is disabled

image

No git installation found

image

No open folder

image

No .git in current folder

image

No .git in current workspace

image

@MadhaviGunapati610
Copy link

click on extension type @disabled you will see all disabled extension on of them will be git just enable(workstation)

Thank you. It is working perfect.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality on-testplan scm General SCM compound issues
Projects
None yet
Development

No branches or pull requests

17 participants