作者:落雪念伯言 | 来源:互联网 | 2023-05-26 13:13
我想将README.md推送到Github.
使用Ubuntu 14.04LTS
所以,我提交以下步骤.
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
我知道这样解决这个错误
git remote set-url origin https://username@github.com/user/repo.git
这样,我必须输入密码.
$ git push origin master
Password:
但我不想输入密码.
我检查了这个,但我没有解决.
推送到Git返回错误代码403致命:HTTP请求失败
请告诉我如何在没有密码的情况下推送.
1> 小智..:
这可以解决您的问题:
git remote set-url origin https://username:userpwd@github.com/user/repo.git
2> Fernando..:
您必须使用https并输入您的密码或使用ssh(并将您的公共ssh密钥关联到您的github帐户)