推送到Git返回致命错误代码403 [英] Pushing to Git returning Error Code 403 fatal

查看:383
本文介绍了推送到Git返回致命错误代码403的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将README.md推送到Github.
使用Ubuntu 14.04LTS
因此,我按以下步骤进行操作.

I want to push README.md to Github.
Using Ubuntu 14.04LTS
So, I commit in the following steps.

echo "# test" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/user/repo.git
git push -u origin master

但是,发生以下错误.

error: The requested URL returned error: 403 Forbidden while accessing https://github.com/user/repo.git/info/refs

fatal: HTTP request failed

我知道可以通过这种方式解决此错误

I know solve this error this way

git remote set-url origin https://username@github.com/user/repo.git

这样,我必须输入密码.

In this way , I must enter password.

$ git push origin master
Password: 

但是我不想输入密码.

我已经检查过了,但是还没有解决.
推送到Git返回错误代码403致命:HTTP请求失败

I have checked this, but I don't solved.
Pushing to Git returning Error Code 403 fatal: HTTP request failed

请告诉我如何在没有密码的情况下进行推送.

Please tell me how to push without password.

推荐答案

您必须使用https并输入密码或使用ssh(并将公共ssh密钥与github帐户相关联)

You have to either use https and enter your password or use ssh (and associate your public ssh key to your github account)

这篇关于推送到Git返回致命错误代码403的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆