首页 > 代码库 > Windows下GIT的SSH设置

Windows下GIT的SSH设置

GIT http://www.tuicool.com/articles/A3Mn6f

 

使用场景复原

git push -u origin master 报错

 

参考官方文档

https://confluence.atlassian.com/bitbucket/use-the-ssh-protocol-with-bitbucket-cloud-221449711.html

执行

ssh-keyscan -t rsa bitbucket.org

获取SSH key之后报错 已存在

 

修正为

ssh-keygen -t rsa -C "xxxxxx@yy.com"

windows保存位置

C:\Users\Excuse\.ssh

git bash 命令 cd c:/users/excuse/.ssh/newkey

 

将生成pub key复制到github创建key

保存后执行

git push -u origin master 报错

Permission denied (publickey).
fatal: Could not read from remote repository.

 

执行 ssh-add 报错

Could not open a connection to your authentication agent.

 

执行 eval `ssh-agent`

OK

 

执行 ssh-add ~/.ssh/tony

OK

 

执行 ssh-add -l

OK

 

执行

git push -u origin master

OK

 

参考

http://blog.chinaunix.net/uid-22355887-id-3342499.html

http://www.cnblogs.com/sheldonxu/archive/2012/09/17/2688281.html

http://www.linuxidc.com/Linux/2015-11/125435.htm

http://blog.itpub.net/25851087/viewspace-1262468/

http://www.jianshu.com/p/31cbbbc5f9fa/

http://jingyan.baidu.com/article/a65957f4e91ccf24e77f9b11.html

http://www.oschina.net/question/54100_10489

Windows下GIT的SSH设置