git生成并添加SSH key

废话不多说,直接上操作:

 

1、安装Git Bash

https://git-scm.com/downloads

 

2、鼠标右键git bash here

git生成并添加SSH key

 

3、执行以下命令:

①   cd ~/.ssh/    【如果没有对应的文件夹,则执行  mkdir  ./.ssh】

②  git config --global user.name "xb12369"

③  git config --global user.email "[email protected]"

④  ssh-****** -t rsa -C "[email protected]"

 

git生成并添加SSH key

 

4、找到C:\Users\xb12369\.ssh 目录,里面有两个文件:id_rsa和id_rsa.pub

 

5、配置ssh【这里是id_rsa.pub里面的内容啊】

git生成并添加SSH key

 

 

配置好了后,你就可以愉快地commit && push

 

 

 

 

 

系统被还原后遇到一个问题:在clone项目的时候一直在报:Clone failed: Failed to start Git process

git生成并添加SSH key

 

然后各种百度,最后发现,尼玛没有将idea和git进行关联,好尴尬啊~~

 

git生成并添加SSH key

 

然后问题得以解决~

 

原文地址:https://blog.****.net/xb12369/article/details/78682018