search

Home  >  Q&A  >  body text

github - 使用git同步个人在不同电脑上的代码问题

我想使用一个github帐号,在A机器上编辑代码后提交,在B机器上更新运行。或者B上编辑,A上更新。
我是不是要把私钥分别在A,B机器上注册?github端不变动?
求指导。。

迷茫迷茫2846 days ago698

reply all(4)I'll reply

  • 天蓬老师

    天蓬老师2017-04-22 09:01:07

    Generate ssh keys on machines A and B respectively, and then add the public keys of A and B to github.

    For detailed process, please check the help provided by github: common SSH Problems

    reply
    0
  • 高洛峰

    高洛峰2017-04-22 09:01:07

    Of course, you can only generate the key pair on A and then copy the private key generated on A to B. The public key only needs to be uploaded once

    reply
    0
  • PHPz

    PHPz2017-04-22 09:01:07

    It is best to generate two pairs of keys, which is easier to manage.

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-22 09:01:07

    Sharing a key is neither elegant nor secure.
    In fact, you can upload multiple keys. I have encountered this problem before. For specific steps, you can read the first part of my article: Problem-driven Git learning.

    reply
    0
  • Cancelreply