简体   繁体   English

新Mac-适用于github的新SSH密钥吗?

[英]New Mac - new SSH keys for github?

I was happily using git on my old Mac (Leopard), then migrated to a new (Lion) Mac. 我很高兴在旧的Mac(豹)型计算机上使用git,然后迁移到新的(狮子)Mac机上。 I installed Github for Mac, and I can clone repositories using that - but not from Terminal. 我安装了Mac版Github,并且可以使用它克隆存储库-但不能从Terminal克隆存储库。

Any git clone from Terminal gets: 来自Terminal的任何git克隆都会得到:

fatal: https://github.com/user/repository.git/info/refs download error - The requested URL returned error: 403 严重: https : //github.com/user/repository.git/info/refs下载错误-请求的URL返回错误:403

Any git pull from Terminal gets: 来自终端的任何git pull得到:

fatal: https://github.com/user/repository.git/info/refs download error - The requested URL returned error: 401 致命: https : //github.com/user/repository.git/info/refs下载错误-请求的URL返回错误:401

Do I need to start again and generate new keys? 我是否需要重新开始并生成新密钥? I assumed everything would be migrated with my user account (the contents of ~/.ssh are unchanged). 我假设所有内容都将使用我的用户帐户迁移(〜/ .ssh的内容不变)。

You are using https url and ssh keys don't even matter. 您使用的是https url和ssh键甚至都没有关系。 Make sure you have your user.name and email for git configured properly in your new Mac ( and while you are at it, config github.user and github.token as well) 确保在新Mac上正确配置了git的user.nameemail (在使用时,还配置github.usergithub.token

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM