C:\Users\User\Documents\Project>git pull
git: 'remote-https' 不是 Git 命令。查看 'git --help'。
提交和添加仍然可以正常工作。
就我的情况而言,我正在WSL Ubuntu中从源代码构建Git。
此发行版未预装libcurl
。在这种情况下,git-remote-http
可执行文件未被构建。因此,我进行了安装:
sudo apt install libcurl4-openssl-dev
然后,我重新配置、重新make
并重新安装,然后Git就可以克隆了。
yum/dnf install libcurl-devel
。 (注:该命令用于安装libcurl库的开发文件。) - cyqsimonlibcurl4-gnutls-dev
,重新编译Git,然后它才能正常工作。 - Peter Becich我曾使用Entware并使用opkg install git
安装了git,但是遇到了这个错误。
通过安装git-http
来解决这个问题,即opkg install git-http
。这也适用于基于OpenWrt的系统。
我之前也遇到了这个错误,通过运行以下命令解决了:
path %path%;C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\bin
这样添加了包含 git-remote-https.exe
文件的文件夹。
完成。
希望这能帮助其他人。
检查 .git/config 文件中的URL。
在我的情况下,错误是远程源位置。
[remote "origin"]
url = "CHECK THIS LOCATION"
[remote "origin"]
url = https://github.com/user/repo
这表明安装不完整或存在问题。Git正在寻找其辅助可执行文件之一git-remote-https
,但未能找到。
如果您在Windows上使用某种安装程序,请尝试重新运行安装程序... 如果您是从源代码构建的,请确保让构建过程自行安装,而不是手动复制git.exe
(并省略它所需的所有其他二进制文件)。
我曾经遇到同样的错误,通过安装最新版本的Git for Windows解决了该问题,下载地址为https://gitforwindows.org/。不过这并不一定适用于每个人。我最近卸载了Git for Windows,却没有意识到我的Git GUI(SourceTree)需要它。
=---------------------=
│git on HEAD (cd3e6062)
-> ls /usr/local/bin/git*
git-remote-https
复制到git
安装路径中。=---------------------=
│git on HEAD (cd3e6062)
-> sudo cp git-remote-https /usr/local/bin
libexec\git-core
文件夹,是否包含git-remote-https.exe
文件? - jingxgit-remote-https.exe
位于C:\Program Files (x86)\Git\libexec\git-core
目录下。 - jingxsudo apt-get install git
。 - Mauricio Toledo