$ git clone https://github.com/PixarAnimationStudios/OpenUSD.git
Cloning into 'OpenUSD'...
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/org/repo.git/'
git clone
命令中的URL是针对OpenUSD存储库的,但错误消息是针对另一个存储库的,它属于我自己的私有存储库。
这是怎么回事?
2条答案
按热度按时间cfh9epnr1#
为了简单地解决这个问题,最好使用ssh密钥而不是http/https
https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account
主要区别是HTTP/HTTPS需要用户名密码对,当它们更改或忘记它们时,您需要重新设置它们。
有了ssh,您就保存了这种不便
jvlzgdj92#
我的
remote.origin.url
被设置为我前面引用的私有存储库。我通过使用以下命令取消设置解决了这个问题:
为了验证
remote.origin.url
,我执行了以下命令: