1. win+R运行cmd命令进入命令窗口;

2. cd .ssh 进入该目录,如果提示没有该目录,就运行mkdir .ssh;

3. 进入目录运行如下命令:

git config --global user.name "xxxxx"      
git config --global user.email "[email protected]"

4. 接着执行:ssh-****** -t rsa -C "[email protected]" ([email protected]是你上边配置的邮箱地址)

5. 如果执行第四步的时候,提示:

'ssh-******' 不是内部或外部命令,也不是可运行的程序
或批处理文件。

ssh-******命令是Git安装目录下的,在环境变量中配置对应的地址即可。正常执行结果如下:

windows:Permission denied, please try again

6.  查看秘钥内容: more id_rsa.pub

windows:Permission denied, please try again

7. 将文件中的内容复制到github仓库SSH Key中即可解决这个问题。 

相关文章: