GitHub/Gitlab SSH配置

纵饮孤独 提交于 2020-02-03 02:16:42

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

首先在本地创建ssh key

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

$ git init
$ git remote add origin git@github.com: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
在这里插入图片描述

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!