环境:CentOS 7。 # 问题 git是从源码自己编译的,但是执行`git clone`时报错。 ```bash [root@bogon ~]# git clone https://xxx git: 'remote-https' is not a git command. See 'git --help'. …… ``` # 解决方法 先安装 libcurl-devel。 重新编译git ```bash make clean ./configure make make install ``` 但是,在我的环境上,问题没有解决。查看 git-remote-http 是否存在: ```bash [root@bogon ~]# ls -l /usr/local/git/libexec/git-core/git-remote* -rwxr-xr-x. 138 root root /usr/local/git/libexec/git-core/git-remote -rwxr-xr-x. 138 root root /usr/local/git/libexec/git-core/git-remote-ext -rwxr-xr-x. 138 root root /usr/local/git/libexec/git-core/git-remote-fd ``` 文件不存在,所以还是有问题。 看看有没有编译出来: ```bash [root@bogon ~]# cd git/git-2.33.1/ [root@bogon git-2.33.1]# find -name "git-remote*" ./git-remote-http ./git-remote-https ./git-remote-ftp ./git-remote-ftps ./git-remote-fd …… ``` 说明 git-remote-http 和 git-remote-https 已经编辑出来了,我们手动 cp 到 /usr/local/git/libexec/git-core/ 目录即可: ```bash [root@bogon git-2.33.1]# cp ./git-remote-http /usr/local/git/libexec/git-core/ [root@bogon git-2.33.1]# cp ./git-remote-https /usr/local/git/libexec/git-core/ ``` 问题解决。 # 参考 * [git: 'remote-https' is not a git command?](https://stackoverflow.com/questions/51366101/git-remote-https-is-not-a-git-command/) * [git fatal: Unable to find remote helper for 'https'](https://blog.csdn.net/zhezhebie/article/details/78035979)