首页 > 其他 > 详细

本地Git环境配置

时间:2016-03-02 18:07:23      阅读:100      评论:0      收藏:0      [点我收藏+]

在Git Bash下获取源码时,提示permission denied publickey。

原因是本地帐号配置不正确,解决办法

 

生成SSH文件

1,进入Git Bash

2,  输入下面文字

ssh-keygen -t rsa -b 4096 -C "这里为github帐号“

 

待提示 "Enter a file in which to save the key," ,直接回车,保存在默认位置

待提示”type a secure passphrase“, 输入一个密码

把生成的SSH文件添加到ssh-agent

1,确保ssh-agent启用

eval "$(ssh-agent -s)"


2,添加SSH key 到ssh-agent:

ssh-add ~/.ssh/id_rsa

 

SSH key添加到GitHub帐号中

参照:https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/

 

 

经过上面配置后,执行clone命令成功

git clone git@github.com:spring-projects/spring-framework.git

 

参考:https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/

 

本地Git环境配置

原文:http://www.cnblogs.com/season2009/p/5235739.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!