推送到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)