我有2个bitbucket的帐户 - 一个用于工作,一个用于个人。在一台笔记本电脑上配置2个Bitbucket帐户:无法克隆代码
Defaultly我使用的是工作帐户,但现在需要克隆从人帐户下的存储库的一些代码,并得到这个错误:
git clone [email protected]:my_personal/project.git
Cloning into 'project'...
repository access denied.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
我产生新的一套钥匙在我的笔记本电脑为个人Bitbucket帐户 - personal
和personal.pub
。我将这个personal
密钥添加到个人BB账户的SSH账户设置。
然后,我已经设置了/Users/adam/.ssh/config
文件:
# Work account
Host bitbucket.org
HostName bitbucket.org
User my_working_bb_id
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
# Personal account
Host bitbucket.org_personal
HostName bitbucket.org
User personal_bb_id
PreferredAuthentications publickey
IdentityFile ~/.ssh/personal
我也跑ssh-add -l
:
2048 SHA256:bYwG+K01In4aDtux36u58ywVqhmALTandY4h8yEg7YE /Users/adam/.ssh/id_rsa (RSA) # <- work-account
2048 SHA256:I3FFdzuS1a3oVy2LAgE+Uh3iQfDIYwys24ZMAAwT0B0 /Users/adam/.ssh/[email protected] (RSA)
2048 SHA256:ye3efWFfSt5tOqj7+APV9eU/Q7lquvbJc0GywyuGm68 /Users/adam/.ssh/presonal (RSA)
2048 SHA256:aGsdBd6lqTqRBXuusvblyUbM9d7Hc5+oJNdVgUwumIM /Users/adam/.ssh/presonal (RSA)
当我运行ssh -T [email protected]
,我得到:
logged in as my_work_bb_id.
我怀疑这里(上面)可能是问题?在我的笔记本电脑上,我仍然只能使用我的工作 - BB ID登录?
或问题在哪里?我整个下午都在与这个问题斗争,但无法继续前进。
我会感激每一个建议!