解决repo sync ( git )报错: git: ‘remote-https‘ is not a git command

这篇具有很好参考价值的文章主要介绍了解决repo sync ( git )报错: git: ‘remote-https‘ is not a git command。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

现象

在Ubuntu 18.04上下载Android源码,遇到报错:git: ‘remote-https’ is not a git command。

$ repo init -u https://android.googlesource.com/platform/manifest -b master
Get https://gerrit.googlesource.com/git-repo/clone.bundle
Get https://gerrit.googlesource.com/git-repo
git: 'remote-https' is not a git command. See 'git --help'.

apt upgrade不能解决文件

使用apt命令升级git到最新版本,不能解决这个问题。

work-around

使用GitHub或者国内的git服务,用ssh方式的下载代码是可以的,HTTPS的方式会报同样的错误。

# ok
$ git clone git@github.com:git/git.git

# error
$ git clone https://github.com/git/git.git

solution

下载git源码,在本地编译:

$ git clone git@github.com:git/git.git
$ make

看网上说需要有libcurl4-openssl-dev这个包,才能编译出git-remote-https。我的电脑已经安装,不确定这个依赖是否必须。

编译完成后,生成文件:git-remote-https,复制到git命令所在目录(或者添加到path中)

$  ll git-remote-http*
-rwxrwxr-x 4 dev dev 12796440 324 12:40 git-remote-https*
$ which git
/usr/local/bin/git
$ sudo cp git-remote-https /usr/local/bin/

再次下载代码,不再提示错误。

之前没有遇到过此类问题,不确定原因。不知道是否和Ubuntu版本有关。
指定原因的同学请提示一下。文章来源地址https://www.toymoban.com/news/detail-490686.html

到了这里,关于解决repo sync ( git )报错: git: ‘remote-https‘ is not a git command的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 解决git:‘remote-http‘ 不是一个 git 命令错误提示

    Jenkins使用Maven构建工程时,设置Git源码管理时报错: Failed to connect to repository : Command “/usr/local/git/bin/git ls-remote -h – http://192.168.1.35/root/javademo.git HEAD” returned status code 128: stdout: stderr: git:‘remote-http’ 不是一个 git 命令。参见 ‘git --help’。 问题分析: 安装Git时缺少curl-d

    2024年02月09日
    浏览(46)
  • git 报错 protocol ‘https‘ is not supported解决

    报错原因:选择不了其他分支代码,甚至都看不到其他分支,我这边解决了两次报错,情况如下: 第一种报错: idea中刷新分支报错如下: Fetch Failed protocol \\\'\\\'https\\\' is not supported 话不多说,直接上 解决方案:  1:可以直接在idea命令窗中执行:git remote set-url origin 你的url 2.然后

    2024年02月06日
    浏览(49)
  • 解决在linux上git clone 时报错 git@gitee.com: Permission denied (publickey). Could not read from remote repo

    今天在gitee上看到一个比较感兴趣的项目,于是就想下载下来研究研究,结果git clone 克隆的时候报错了,报错如下: git@gitee.com: Permission denied (publickey).fatal: Could not read from remote repository.Please make sure you have the correct access rights and the repository exists. Permission denied (publickey) 没有权

    2024年02月11日
    浏览(42)
  • Git 更改remote repo 地址

    我们想更换远程 repo 地址, 因为我们仓库更换了名称. git remote rename origin 查看现在的 romote 地址 参考文档 https://www.cnblogs.com/Nyan-Workflow-FC/p/14454788.html 分享快乐,留住感动. \\\'2023-12-10 06:53:23\\\' --frank

    2024年02月04日
    浏览(27)
  • git上传报错 git报错:remote: Access denied 拒绝访问 fatal: unable to access ‘ https:/ /gitee. cohe requested UR

    这个问题一般是git账号不一致(本地配置与远程仓库账号) 解决办法:进入控制面板-用户账户-管理凭据-Windows凭据  修改成与远程仓库一致的账号密码就可以啦

    2024年02月05日
    浏览(37)
  • Jenkins构建报错:The recommended git tool is: NONE,Fetching changes from the remote Git repository

    原因是该任务所在的工作空间属主:属组不是Jenkins 解决方法: 如果需要单独给某个普通用户对目录操作的权限可以执行下面的操作: 拓展:

    2024年02月11日
    浏览(41)
  • 关于 IntelliJ Maven error: Repository is non-nexus repo, or is not indexed (remote update error) 的问题

    今天用IDEA maven导入github上一个项目的包,报了 无法解析该依赖 的错误 查看 File | Settings | Build, Execution, Deployment | Build Tools | Maven | Repositories 发现(r emote update error )无法更新远程库,报错信息是 IntelliJ Maven error: Repository is non-nexus repo, or is not indexed 在互联网上找了很久的解决

    2024年02月07日
    浏览(29)
  • 【报错解决】CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/main/nux-64

    下包的时候遇到如下报错: 解决方法: 一、终端修改: ①查看自己的下载channels信息: ②按照如下命令添加conda镜像 ③更新conda 然后就可以安装需要的包了 二、Windows修改: 找到.condarc文件(所在C盘--用户--用户名文件夹目录下)之后删除原来的内容,复制粘贴如下命令:

    2024年02月13日
    浏览(42)
  • AOSP源码下载方法,解决repo sync错误:android-13.0.0_r82

    最近写文章,反复多次折腾AOSP代码,因通过网络repo sync aosp代码,能一次顺利下载的概率很低,以前就经常遇到,但从未总结,导致自己也要回头检索方法,所以觉得可以总结一下,涉及下载最新、各分支AOSP代码的方法,以及如何处理所遇到的同步错误及其解决方法,现分享

    2024年02月03日
    浏览(49)
  • jenkins:> git init # timeout=10 ERROR: Error cloning remote repo ‘origin‘

    这是我在build now时遇到的报错,此时的这个节点是从节点,刚刚搭建完成主从节点去测试能否正常进行build。然后就遇到了这个报错 检查时节点项目配置是没有错误的。所以就是代码没有拉取成功,所以就想是不是从节点的主机上是没有安装git,导致无法拉取代码。 然后从节

    2024年02月09日
    浏览(48)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包