github 每个仓库有两类地址:https和ssh通道。

  1. https通道获取代码方便,提交过程中每次都需要输入用户名和密码。
  2. ssh通道需要提前配置号ssh-key的,后面clone的工程提交不需要输入用户和密码。

查看本地仓库对应的远程地址:

$ git remote -v
origin	https://github.com/horst3180/arc-theme (fetch)
origin	https://github.com/horst3180/arc-theme (push)

切换为ssh通道:

$ git remote set-url origin git@github.com:horst3180/arc-theme.git

$ git remote -v
origin	git@github.com:horst3180/arc-theme.git (fetch)
origin	git@github.com:horst3180/arc-theme.git (push)

提示:使用ssh通道需要搞定公钥配置。

添加ssh-key : https://help.github.com/articles/connecting-to-github-with-ssh/

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-20
  • 2022-01-11
  • 2022-12-23
  • 2021-05-18
猜你喜欢
  • 2021-09-02
  • 2022-12-23
  • 2021-06-28
  • 2021-11-29
  • 2021-04-09
  • 2021-07-11
  • 2021-04-26
相关资源
相似解决方案