当前位置 博文首页 > Ghost_02的博客:git 版本太老,导致的git clone 失败

    Ghost_02的博客:git 版本太老,导致的git clone 失败

    作者:[db:作者] 时间:2021-09-21 11:57

    go get github.com/astaxie/beego
    # cd .; git clone https://github.com/astaxie/beego /home/weijiaxiang/tmp/tmp_lib/privateline/temp/src/github.com/astaxie/beego
    Initialized empty Git repository in /home/weijiaxiang/tmp/tmp_lib/privateline/temp/src/github.com/astaxie/beego/.git/
    error:  while accessing https://github.com/astaxie/beego/info/refs
    
    fatal: HTTP request failed
    package github.com/astaxie/beego: exit status 128
    

    首先 go get 的原理就是git clone 。我在装beego的时候总是出现这个问题。

    解决方法一: 升级 git。

    解决方法二:

    git config --global url."git://github.com/astaxie/beego".insteadOf "https://github.com/astaxie/beego" 

    然后再执行 go get github.com/astaxie/beego

    cs