linux生成ssh的一对公钥和私钥,然后配置git ssh拉取仓库代码

linux server中如果想通过ssh方式拉取代码,那么就需要做一些配置:

1.需要linux生成ssh的一对公钥和私钥:

具体可以参考这篇文章:https://www.cnblogs.com/pingguomang/p/17926730.html

 

2.把这个公钥配置到gitlab仓库的ssh and gpg keys中:

进入gitlab密钥对设置settings页面->SSH and GPG keys,标题随便,公钥粘贴进来(一定要完整),确定即可

 git clone一下试试:

 表示成功了!

 

posted @ 2024-05-14 11:16  苹果芒  阅读(50)  评论(0编辑  收藏  举报