两个ssh密钥未连接的gitlab(配置已更新)

两个ssh密钥未连接的gitlab(配置已更新),git,macos,ssh,gitlab,Git,Macos,Ssh,Gitlab,我在mac上有一个gitlab帐户,上面有我工作帐户所需的ssh密钥。我正试图为我所有的个人项目建立gitlab。我在gitlab上创建了一个个人帐户,并创建了一个ssh密钥 我在~/.shh/中编辑了配置文件,如下所示 Host markgameforeverything.gitlab.com HostName gitlab.com User git PreferredAuthentications publickey IdentityFile ~/.ssh/p

我在mac上有一个gitlab帐户,上面有我工作帐户所需的ssh密钥。我正试图为我所有的个人项目建立gitlab。我在gitlab上创建了一个个人帐户,并创建了一个ssh密钥

我在~/.shh/中编辑了配置文件,如下所示

Host markgameforeverything.gitlab.com
    HostName gitlab.com
    User git
    PreferredAuthentications publickey
    IdentityFile ~/.ssh/personal.pub

Host markbreadcreative.gitlab.com
    HostName gitlab.com
    PreferredAuthentications publickey
    IdentityFile ~/.ssh/id_rsa.pub
但是我不能

git pull
当我得到这个错误

GitLab: The project you were looking for could not be found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists
如果我打字

ssh -T git@gitlab.com
我明白了

(错误的帐户)
有人能建议我采取进一步的措施吗?或者在我的代码中看到错误吗?

检查您的
.git/config
的外观。我想你没有
url
开头的
markbreadcreative.
markgameforeverything.
前缀

要使设置正常工作,您需要修改回购协议中的行

url = git@gitlab.com:whatever.git

分别取决于您要使用的帐户。您可以使用以下方法检查配置:

ssh -T git@markbreadcreative.gitlab.com
ssh -T git@markgameforeverything.gitlab.com

(应返回不同的结果)。如果没有,则从这些命令(
ssh-vvt)发布详细日志git@markgameforeverything.gitlab.com
)。

对不起,如果我使用ssh-T,如何打开.git/configgit@markbreadcreative.gitlab.com例如,我在您最喜欢的文本编辑器中使用“打开菜单”获得hello Marks。我有完全相同的问题,但是我无法检查
ssh-Tgit@.gitlab.com
正如它所说的“无法解析主机名”。@aalaap,因为您没有在
~/.ssh/config
中正确配置ssh。
url = git@markbreadcreative.gitlab.com:whatever.git
url = git@markgameforeverything.gitlab.com:whatever.git
ssh -T git@markbreadcreative.gitlab.com
ssh -T git@markgameforeverything.gitlab.com