Unable to connect GitLab with Visual Studio Code

Unable to connect GitLab with Visual Studio Code

Questions : Unable to connect GitLab with Visual Studio Code

929

I’m using a self-hosted GitLab instance in4codes_gitlab-api deployed for the company, along with Visual in4codes_gitlab-api Studio Code.

I downloaded the extension “GitLab Workflow” in4codes_gitlab-api in Visual Studio Code, so I can see my in4codes_gitlab-api GitLab projects hosted in the company in4codes_gitlab-api instance.

During setup, I entered:

  • The company GitLab instance URL “https://XXXXXXXXXXXXXXXXXXXXXXXXXX”
  • The PAT (personal access token) related to my personal space that contains all my projects.

I also entered the below URL in the in4codes_gitlab-api configuration file of Visual Studio Code: in4codes_gitlab-api Settings → Extensions in4codes_gitlab-api → Gitlab Workflow → in4codes_gitlab-api Instance URL as described in this article, in4codes_gitlab-api section: Setup / Step 2:

 { "window.zoomLevel": -1, "workbench.colorTheme": "Visual Studio Dark", "terminal.integrated.shell.windows": "C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe", "gitlab.instanceUrl": "https://XXXXXXXXXXXXXXXXXXXXXXXXXX" } 

But when trying to see my GitLab projects in4codes_gitlab-api from VS Code, I get this error message:

 Failed to parse GitLab API response Command failed with exit code 128: git ls-remote --get-url fatal: No remote configured to list refs from. Error: Command failed with exit code 128: git ls-remote --get-url fatal: No remote configured to list refs from. at makeError (c:UsersXXXXXXX.vscodeextensionsgitlab.gitlab-workflow-3.9.0node_modulesexecaliberror.js:59:11) at handlePromise (c:UsersXXXXXXX.vscodeextensionsgitlab.gitlab-workflow-3.9.0node_modulesexecaindex.js:114:26) at processTicksAndRejections (internal/process/task_queues.js:94:5) 

Total Answers 3
33

Answers 1 : of Unable to connect GitLab with Visual Studio Code

It sounds like the extension doesn’t in4codes_visual-studio-code know what remote to fetch from GitLab (a in4codes_visual-studio-code configuration issue rather than in4codes_visual-studio-code connection). Try adding this to your in4codes_visual-studio-code settings.json file:

“gitlab.remoteName”: “origin”,

If you use a different remote name, then in4codes_visual-studio-code replace “origin” with your remote. You in4codes_visual-studio-code can see the details of your remote using in4codes_visual-studio-code Git:

git remote

0

3

Answers 2 : of Unable to connect GitLab with Visual Studio Code

Visual Studio Code includes native in4codes_visual-studio-code capability to connect with GitLab.

At “Start”, click on “clone repository” in4codes_visual-studio-code and then paste the target URL at the in4codes_visual-studio-code navigation bar:

0

1

Answers 3 : of Unable to connect GitLab with Visual Studio Code

I found this answer on their docs, if in4codes_visual-studio-code you already using Windows you should in4codes_visual-studio-code turn off your http.systemCertificates in4codes_visual-studio-code in VSC setting.json

thanks to this answer here

0