如何把gitee拉取代码的方式从http变为ssh

发布时间 2023-05-22 17:41:25作者: 山雨欲來風滿楼

前言:

  • 因为我已经生成的ssh秘钥,但我每次拉取代码的时候还是需要输入密码。
  • 搜索资料发现,是拉取密码的方式还是http
  • 所以我把这个方式转换为ssh

前提:

  • 已经生成了秘钥

解决:

1.查看连接方式:

git remote -v

 

 2.改为ssh

git remote set-url origin 《你自己的ssh的url》

我的是:

 3.在看一下连接方式

git remote -v

 

 4.拉取一下试试

git pull

 

 

git 如何生成秘钥?参考资料:https://gitee.com/help/articles/4181#article-header0

本文的主要参考资料:https://www.jianshu.com/p/ce582a6db129