简体   繁体   English

如何更改本地git ssh-key?

[英]how to change local git ssh-key?

I was made a big mistake:override the local ssh-key. 我犯了一个大错误:覆盖本地的ssh-key。

Now, i generated a new ssh-key, and added it to the gitlab. 现在,我生成了一个新的ssh-key,并将其添加到gitlab中。 But i'm still can't push code to the remote. 但是我仍然无法将代码推送到远程。

this is the error message 这是错误消息

Please tell me how to switch the local ssh-key, thanks! 请告诉我如何切换本地ssh键,谢谢!

My operating system is OSX 10.11 我的操作系统是OSX 10.11

For ubuntu user, Please try this on terminal 对于ubuntu用户,请在终端上尝试

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

Add generated ssh key into /Users/you/.ssh/id_rsa file 将生成的ssh密钥添加到/Users/you/.ssh/id_rsa文件

For more detail follow steps from below link 有关更多详细信息,请从下面的链接进行操作

https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/ https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/

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

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