git报错fatal: HTTP request failed,提示403

1.  在使用git pull、git push、git clone会报类似如下的错误:
        sudo git clone https://github.com/pcduino/a20-kernel
        fatal: HTTP request failed  

    一般是由于以下几种问题造成的:

1)Git版本的问题。


    使用如下指令查看版本:   
        # git --version  
        git version 1.7.0.1  

    可以通过安装更高的版本解决问题

2)系统的时间不对

使用命令

date -s "25 MAY 2015 13:45:00"

修改时间即可。


 2.   报错fatal: Unable to find remote helper for 'https'

是因为git 是通过curl请求网络的。仔细检查发现

    <span style="font-family: Arial, Helvetica, sans-serif;">checking for curl_global_init in -lcurl... no</span>  

安装 curl及curl-devel
    yum install curl curl-devel  

然后重新编译即可,即三步走。

3)权限不对

这是权限问题,可以修改.git/config文件追加用户名和密码
详细:
From:http://stackoverflow.com/questions/7438313/pushing-to-git-returning-error-code-403-fatal-http-request-failed

To definitely be able to login using https protocol, you should first set your authentication credential to the git Remote URI:

git remote set-url origin https://yourusername@github.com/user/repo.git
Then you'll be asked for a password when trying to 
git push.


In fact, this is on the http authentication format. You could set a password too:


https://youruser:password@github.com/user/repo.git
You should be aware that if you do this, your github password will be stored in plaintext in your .git directory, which is obviously undesirable.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值