Git http转ssh教程

1、配置用户和邮箱

$ git config --global user.name "your_name"

$ git config --global user.email "your_email@example.com"

2、生成新的公钥
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"


2.gitlab将http更换为ssh方式
首先删除本地的私钥文件,才能够配置新的ssh
(1). 删除原服务端
git remote remove origin

或重命名原有服务端名称

git remote rename origin old-origin

(2). 添加新目标服务端地址
git remote add origin 自己仓库的ssh地址

posted @ 2019-11-18 16:02  雁书几封  阅读(1972)  评论(0)    收藏  举报