git clone 报错,是我的问题还是网络的问题

2021-03-02 14:50:32 +08:00
 zxCoder

git 版本 2.30.1

git clone https://github.com/google/leveldb.git

报错是

Cloning into 'leveldb'...
git: 'remote-https' is not a git command. See 'git --help'.

改成 ssh,这样可以,但是加上 submodule 就又报错了

git clone git@github.com:google/leveldb.git
git clone --recurse-submodules git@github.com:google/leveldb.git

报错是

Submodule 'third_party/benchmark' ( https://github.com/google/benchmark) registered for path 'third_party/benchmark'
Submodule 'third_party/googletest' ( https://github.com/google/googletest.git) registered for path 'third_party/googletest'
Cloning into '/home/keane/CLionProjects/leveldb/third_party/benchmark'...
git: 'remote-https' is not a git command. See 'git --help'.
fatal: clone of 'https://github.com/google/benchmark' into submodule path '/home/keane/CLionProjects/leveldb/third_party/benchmark' failed
Failed to clone 'third_party/benchmark'. Retry scheduled
Cloning into '/home/keane/CLionProjects/leveldb/third_party/googletest'...
git: 'remote-https' is not a git command. See 'git --help'.
fatal: clone of 'https://github.com/google/googletest.git' into submodule path '/home/keane/CLionProjects/leveldb/third_party/googletest' failed
Failed to clone 'third_party/googletest'. Retry scheduled
Cloning into '/home/keane/CLionProjects/leveldb/third_party/benchmark'...
git: 'remote-https' is not a git command. See 'git --help'.
fatal: clone of 'https://github.com/google/benchmark' into submodule path '/home/keane/CLionProjects/leveldb/third_party/benchmark' failed
Failed to clone 'third_party/benchmark' a second time, aborting
1538 次点击
所在节点    问与答
6 条回复
imdong
2021-03-02 14:53:36 +08:00
似乎还是因为 clone 了 https 导致的问题.

没遇到过,建议参考 https://www.google.com.hk/search?q=git%3A+%27remote-https%27+is+not+a+git+command.
zxCoder
2021-03-02 14:58:29 +08:00
@imdong 谷歌过了 试了好多都没能解决
zxCoder
2021-03-02 14:58:44 +08:00
补充:是 Linux 系统
LRvx
2021-03-02 21:18:18 +08:00
你这个 git 的版本是自己源码编译的吗,我记得之前自己装 git 的时候会漏掉 libexec/git-core 里的一些会漏掉 git-remote-http 等文件,导致 https 不能 clone,完整的安装就没这个问题了
zxCoder
2021-03-02 21:46:20 +08:00
@LRvx 我猜确实是这个问题。。。。apt 安装了一个就好了
LRvx
2021-03-02 21:49:46 +08:00
@zxCoder 找一个靠谱的教程重新装一下吧,我记得我装的当时要 openssl 等依赖,如果没装好,就有这个问题

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/757636

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX