簡體   English   中英

無法將 GitLab 與 Visual Studio Code 連接

[英]Unable to connect GitLab with Visual Studio Code

我正在使用為公司部署的自托管 GitLab 實例以及 Visual Studio Code。

我在 Visual Studio Code 中下載了擴展“GitLab Workflow”,因此我可以看到我的 GitLab 項目托管在公司實例中。

在設置過程中,我輸入:

  • 公司 GitLab 實例 URL "https://XXXXXXXXXXXXXXXXXXXXXXXXXXX"
  • 與包含我所有項目的個人空間相關的 PAT(個人訪問令牌)。

我還在Visual Studio Code的配置文件中輸入了下面的URL:設置擴展Gitlab工作流程實例URL ,如節所述:

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

但是當試圖從 VS Code 查看我的 GitLab 項目時,我收到以下錯誤消息:

 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:\Users\XXXXXXX\.vscode\extensions\gitlab.gitlab-workflow-3.9.0\node_modules\execa\lib\error.js:59:11)
  at handlePromise (c:\Users\XXXXXXX\.vscode\extensions\gitlab.gitlab-workflow-3.9.0\node_modules\execa\index.js:114:26)
  at processTicksAndRejections (internal/process/task_queues.js:94:5)

聽起來擴展不知道從 GitLab 獲取什么遠程(配置問題而不是連接)。 嘗試將此添加到您的settings.json文件中:

"gitlab.remoteName": "origin",

如果您使用不同的遙控器名稱,請將“origin”替換為您的遙控器。 您可以使用 Git 查看遙控器的詳細信息:

git remote

Visual Studio Code 包含與 GitLab 連接的本機功能。

“開始”處,單擊“克隆存儲庫” ,然后將目標 URL 粘貼到導航欄:

請看這張圖片

我在他們的文檔上找到了這個答案,如果你已經在使用 Windows 你應該關閉你的http.systemCertificates in VSC setting.json

在此處輸入圖像描述

感謝這里的答案

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM