GitHub/Gitlab SSH配置

SSH: Setup your ssh keys and deploy keys for secure access to your projects.

首先在本地创建ssh key

$ ssh-keygen -t rsa -C [email protected] //[email protected]: 在github上注册的邮箱
连续三个回车
cat ~/.ssh/id_rsa.pub
复制里面的key到github
在这里插入图片描述
$ git config --global user.name “your name”
$ git config --global user.email “[email protected]

$ git init
$ git remote add origin [email protected]:yourName/yourRepo.git

git bash保存密码
git config --global credential.helper store

windows界面git操作:(不用每次输入密码)

1.生成putty key:
在 开始–>所有程序 找到TortoiseGit 点击 Puttygen ,进入点击load
在这里插入图片描述
将.ssh文件夹中的密钥id_rsa文件导入,然后弹出对话框提示导入成功,
接着点击save private key来保存ppk文件到指定的位置(C:\Users\yangjinjing\Desktop\123.ppk)
2.设置Load Putty Key
在这里插入图片描述