尝试使用 HTTPS 协议(protocol)克隆我有权访问的私有(private)存储库,因为它只允许传出流量。
git 不要求输入密码,只是失败了。
error: The requested URL returned error: 403 Forbidden while accessing https://github.com/blah/blahblah.git/info/refs
我错过了什么?
最佳答案
您是否尝试在克隆 URL 中插入用户名(和可选的密码)?
git clone https://username@github.com/blah/blahblah.git
或者如果您接受将密码存储在普通 View 中的后果:
git clone https://username:password@github.com/blah/blahblah.git
看到这个线程有很多有用的信息:
How to provide username and password when run "git clone git@remote.git"?
编辑:我原来的答案只是一个快速修复,没有了解提问者的完整历史,它也可以在无人值守的情况下工作,但为了最佳安全实践,最好让 Git 存储您的密码。参见@phpguru 的回答:https://stackoverflow.com/a/29018371/257090
关于Git 使用 HTTPS 访问私有(private)仓库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24008982/