Change:
async getRepositoryRoot(repositoryPath: string): Promise<string> { const result = await this.exec(repositoryPath, ['rev-parse', '--show-toplevel']); <del> return path.normalize(result.stdout.trim()); </del> <ins> // Keep trailing spaces which are part of the directory name return path.normalize(result.stdout.trimLeft().replace(/(rn|r|n)+$/, '')); </ins> } async getRepositoryDotGit(repositoryPath: string): Promise<string> {

Discussion:
<!-- Please search existing issues to avoid creating duplicates. --<!-- Also please test using the latest insiders build to make sure your issue has not already been fixed: --<!-- Use Help Report Issue to prefill these. --- VSCode Version: 1.38.1 OS Version: MacOS High Sierra 10.13.6 Steps to Reproduce: Git install (git version 2.23.0) VSCode install (1.38.1) Control tab in activity bar shows shows in : git location in terminal to to attempt to fix the bug Control tab in activity bar shows still shows "no source control provider registered" clicking on the sign on top right corner of Source Control tab, it add a folder in the workspace folder. Confirmed by =Extension enabled <!-- Launch with to check. --Does this issue occur when all extensions are disabled?: Yes I have just started to use VSCode, but my git installation is not detected by the Source Control Tab. If I work in a directory without using git, I can initialize a folder with the sign, but I can't make commit. If I am in a directory with already a git tracking, I still have this message.
(Experimental duplicate detection) Thanks for submitting this issue. Please also check if it is already covered by an existing one, like: <!-- score: 0.481 --<!-- potentialduplicatescomment --
Unfortunately, it doesn't help.
Can you show me the full output of , when you open a folder which is a git repo?
I just "up" graded VS code and all source control is gone. !
Same here. Apparently VS Code auto-updated, and now I get the same as ExtAnimal's screenshot.
It really does have a productivity hit when I can't see modified code zones!
Turns out it wasn't VS Code that was the problem, I had recently updated Xcode and had to agree to new TOS. Once I did that git started working again.
Hi here the full output of I would like to give you an update, earlier today I have created an other workspace. For this new workspace Git was automatically detected, but only for this one. So for the moment I only have two configured workstations, one with this problem and the second, the new one without. I tried to update Xcode before opening this issue, but unsuccessfully.
It was XCode's fault.

I had to start XCode, do "Check for updates", agree to the terms and update. Then restart VS Code. Now I have source control. You should probably flag this up as an issue.
Same as Could you check if this is your case too?
I've just ran in the terminal. Here my full output : I may have an issue with my Xcode installation...
Another use is reporting similar issue microsoft/vscode-java-pack
I also encountered the same problem. 1uninstall VsCode, 2remove all the extensions 3install new VsCode, it is work
Did you fix it?
I've fixed it and tried solution whiteout succes.
You've fixed it? You no longer have the problem?
Sorry for this misunderstanding. I fixed my Xcode issue, but it did not fix my Git problem.
Does still show the same? Does from the command line work?
Hi! Here what's return now: And still work fine.
So, what does and return if you run it from your folder?
I've ran these commands through the VSCode console and I've got this :
Can you reproduce the issue on other repositories? Namely, on a path which doesn't have spaces?
I thought It was due to the spaces, but here an other repo that have spaces and I don't have this issue. Unfortunately, I can't reproduce it on other repo, even in which that doesn't have spaces.
Can you run and change it to and then check the git output? Maybe more info comes out.
Here is the result in the repo that is problematic: And in the previous repo where I don't have the issue, this is the output:
Is a symlink maybe?
No it's a directory :
Can you reclone that repository into another folder? Does that work?
Ok, I've just figured out how to solve this bug. I had an space at the end of my git repo name. Instead of I had . Removing the extra space fix this issue. Maybe you could find a fix for handling extra space at the end of a folder? In any case, thank you for your help!
I can definitely reproduce. Great catch!