git版本管理之git-ssh 配置和使用
2016-07-29 23:33
387 查看
1.设置用户名和邮箱
2.生成密钥
3.复制/c/Users/Administrator/.ssh/id_rsa.pub中生成的内容,登陆github账号添加ssh-key
title自定义
将公钥添加到key中,点击ADD保存
4.测试
出现以上信息,则设置成功,可以使用ssh访问提交代码。
ps:以上命令在gitbash软件命令行执行。安装git
$ git config --global user.name "gsx-gh" $ git config --global user.email "gsx@126.com"
2.生成密钥
$ ssh-keygen -t rsa -C "gsx@126.com" Generating public/private rsa key pair. Enter file in which to save the key (/c/Users/Administrator/.ssh/id_rsa): Created directory '/c/Users/Administrator/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /c/Users/Administrator/.ssh/id_rsa. Your public key has been saved in /c/Users/Administrator/.ssh/id_rsa.pub. The key fingerprint is: SHA256:XwstvBad8mew3XT+IRSPV9+EZEL6WNEje+dW/qzAGFo gsx@126.com The key's randomart image is: +---[RSA 2048]----+ | .+.o | | ..=o. | | . .+..o| | . *..=.*| | S E B+ **| | + %.=.+=| | . = *.+++| | . +. =| | ...| +----[SHA256]-----+
3.复制/c/Users/Administrator/.ssh/id_rsa.pub中生成的内容,登陆github账号添加ssh-key
title自定义
将公钥添加到key中,点击ADD保存
4.测试
$ ssh -T git@github.com The authenticity of host 'github.com (192.30.253.112)' can't be established. RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of known hosts. Hi gsx! You've successfully authenticated, but GitHub does not provide shell access.
出现以上信息,则设置成功,可以使用ssh访问提交代码。
ps:以上命令在gitbash软件命令行执行。安装git
相关文章推荐
- dubbo注册部分源码分析与我思考的miniDubbo结构
- tushare数据写入SQLite 数据库
- 数据结构实验之栈四:括号匹配
- 用MKNetWork来Post一个XML字符串
- 使用JNI将C结构体转为JAVA实体类
- Java线程同步的几种方式
- Palindromic Squares
- JobHarvest——校招并发爬虫系统(更新中)
- Spark入门实战系列--8.Spark MLlib(下)--SparkMLlib实战 学习笔记
- Android页面跳转动画简介
- git冲突 解决
- java-基础-JNI本地栈
- 笔记:静态化配置
- Android的几种消息通信对比
- 为什么使用ConcurrentHashMap
- 高斯消元法 专题
- Name that Num
- 零散笔记
- 4.PHP接入支付宝手机网站支付、移动支付接口
- 【POJ3278】Catch That Cow