gitlab配置tortoiseGit
转载地址 https://www.jianshu.com/p/5d89119bece7
git上传下载走的都是ssh 协议,每次上传下载需要密码比较麻烦,配置一下对应的公钥 私匙,
1. 首先我们看一个错误页面,当自己没有配置sshkey的时候,pull或者push代码会有如下的界面。

上面这段话的大体意思是在本机中没有找到相应的安全凭证,需要你做一些选择……我们点击取消操作,看看如何解决这个问题。
2.配置SSH Key
SSH的原理我们就不多说了,这里使用的是rsa的非对称的加密算法,验证的机制就是我们本机会生成一对公钥私钥,私钥自己保存,公钥放在gitLab上面。
首先在TortoiseGit的安装目录下的bin文件夹中找到puttygen.exe这个工具,或者在开始菜单搜索这个程序(如果你没有选择安装目录的话默认路径应该是:C:\ProgramFiles\TortoiseGit\bin),这个工具是用来生成密钥对的,打开它点击Generate,然后鼠标在进度条下方不停的晃动,几秒后就会生成密钥对,点击Savaprivate key保存私钥到本地(输入一个名字,保存到一个你找的到的文件夹),我一般放在C盘下。不要关闭这个窗口,接下来还会用到。



3.在本地项目中配置SSH Key
在项目的文件夹上右击鼠标,选择TortoiseGit—Settings—Remot,
因为我用的是汉化版本,所有文字介绍略有差异,在PuttyKey后选择刚才保存到本地的私钥,然后点击应用。


6在Pull或Push项目的时候,记得勾选AutoloadPutty Key选项。
