简体   繁体   English

Github-使用一个SSH密钥复制两个存储库

[英]Github - Copying two repos with one SSH key

I want to pull two private github repos via bash script to my server. 我想通过bash脚本将两个私有github存储库拉到我的服务器。 I used to do just one and this worked fine. 我曾经只做过一次,而且效果很好。 This is the process that worked for me: 这是对我有用的过程:

  • Generate SSH on server 在服务器上生成SSH
  • Add to github repo's ssh list 添加到github repo的ssh列表
  • Compelte the git pull request 强制执行git pull请求

Now I am trying to do this: 现在,我正在尝试这样做:

  • Generate SSH 生成SSH
  • Add key to first github repo's ssh list 将密钥添加到第一个github repo的ssh列表
  • Add key to second github repo's ssh list 将密钥添加到第二个github repo的ssh列表
  • Compelte the first repo git pull request 强制执行第一个repo git pull请求
  • Compelte the second repo git pull request 强制执行第二个回购git pull请求

However, when I try to add the same key to the second repo I want to copy, github says it is already in use. 但是,当我尝试将相同的密钥添加到要复制的第二个存储库时,github表示它已在使用中。 How am I supposed to do this? 我应该怎么做? Should I be generating two seperate SSH's keys on the server and use one for one github repo and one for the other? 我是否应该在服务器上生成两个单独的SSH密钥,并将一个用于一个github存储库,另一个用于另一个?

SSH keys on github are user-specific and not repo-specific. github上的SSH密钥是特定于用户的,而不是特定于回购协议的。 Did you try to simply git pull from second repo after pulling from the first? 您是否尝试过从第一个回购中简单地从第二个回购中进行git pull?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM