How to use multiple Git SSH keys on Eclipse?

后端 未结 1 1012
梦如初夏
梦如初夏 2020-12-10 20:44

I looked several answers and forums for a solution but I could not find a single one that works.

I have this scenario:

  • Eclipse Luna Service Release 2 (
相关标签:
1条回答
  • 2020-12-10 21:05

    Host bitbucket bitbucket.org? You don't declare multiple entry names on one Host section.

    I would expect to see in a ssh config file declaring multiple keys:

    Host bitbucketuserA
        Hostname bitbucket.org
        IdentityFile ~/.ssh/id_rsa
        User git
    
    Host bitbucketuserB
        Hostname bitbucket.org
        IdentityFile ~/.ssh/other
        User git
    

    And you would use ssh url like

    bitbucketuserA:userA/myrepo1
    bitbucketuserB:userB/myrepo2
    

    (this is similar to what I suggested for "How to work on personal GitHub repo from office computer whose SSH key is already added to a work related GitHub account?")

    0 讨论(0)
提交回复
热议问题