Xcode 10.1使用ssh键推送到github

问题描述:

我已经从命令行手动创建了ssh密钥,并将其添加到我的gihub,gitlab帐户中.一切正常,例如使用命令行和源代码树客户端进行克隆,推送,拉取等.

I had created my ssh keys manually from command line and added to my gihub, gitlab accounts. Everything work fine e.g cloning, pushing, pulling etc using command line and source tree client.

问题是当我尝试使用xcode推送时,出现错误消息Authentication failed because the credentials were rejected.查看屏幕截图

The problem is when I try to push using xcode it gives me error saying that Authentication failed because the credentials were rejected. See screenshot

请注意,Xcode能够使用ssh键克隆存储库,但不能推送(对于推送更改,我要么使用命令行,要么使用源代码树).

Please note that Xcode is able to clone the repos using ssh keys but is not able to push(for pushing the changes I either use command line or source tree).

使用以下命令创建密钥:

Create a key with the following command:

ssh-keygen -t rsa -C "xxx@yyyy.com" -m PEM

应该添加-m PEM