簡體   English   中英

git:'remote-https' 不是 git 命令 - Visual Studio Code Sync

[英]git: 'remote-https' is not a git command - Visual Studio Code Sync

嘗試使用 Visual 左下角的“同步更改”按鈕時

Studio Code 我得到一個

git: 'remote-https' is not a git command

日志顯示:

> git pull --tags origin master
git: 'remote-https' is not a git command. See 'git --help'.

但是,我仍然可以從 VS Code 中的終端 Git 拉/推。 唯一導致此錯誤的是“同步更改”按鈕。 我已經為 Windows 重新安裝了 Git,但它沒有解決問題。 我可以看到 git-remote-https.exe 位於

“C:\Program Files\Git\mingw64\libexec\git-core”

但我不確定 VS Code Synchronize Change 應該如何引用它。

如果您看到類似以下的錯誤:

在此處輸入圖像描述

首先檢查您的%PATH%
在 CMD 中,鍵入set path

要進行測試,請輸入 CMD:

set PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\
set "GH=C:\Program Files\Git"
set "PATH=%GH%\bin;%GH%\cmd;%GH%\usr\bin;%GH%\mingw64\bin;%GH%\mingw64\libexec\git-core;%PATH%"

然后,仍然從那個 CMD 啟動 VSCode(確保先關閉另一個)

"%LOCALAPPDATA%\Programs\Microsoft VS Code\bin\code.cmd"

看看問題是否仍然存在。

另一種方法是在 git.path 中設置C:\Program Files\Git\bin\git.exe git.path如此處所示

暫無
暫無

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

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