GitHub Error: Key already in use

后端 未结 7 2061
逝去的感伤
逝去的感伤 2021-01-30 02:54

I have created two GitHub accounts. One for my work user and one for my personal self. I needed to do catch up on some work and as such cloned my work repo onto my personal PC

7条回答
  •  我在风中等你
    2021-01-30 03:37

    you can use the same ssh key for different github repositories but cannot use the same ssh key for many repositories (i.e,same repository from different logins or from forked) as github will not allow same deploy key more than once for a repository

    You can create a different key in your machine without disturbing your existing keys like:ssh-keygen -t rsa -C "your_email@example.com"
    Now provide your file name to identify your key for the repository

    Enter file in which to save the key (/home/demo/.ssh/id_rsa):/home/demo/.ssh/id_rsa_mykey

    See https://developer.github.com/guides/managing-deploy-keys/#deploy-keys for details.

提交回复
热议问题