Git SSH Key生成步骤说明
来源:互联网 发布:ubuntu expect spawn 编辑:程序博客网 时间:2024/06/16 12:07
Git SSH Key生成步骤
说明:
Git是分布式的代码管理工具,远程的代码管理是可以基于SSH的,所以在使用git的时候需要去配置SSH,方便代码的提交。
Git的SSH配置如下
一、设置user name和email
首先,点击鼠标右键打开git cmd面板,操作如下图:
在git命令行中去配置user name和email,具体如下:
$ git config --global user.name "Your name"$ git config --global user.email "email@example.com"
二、生成SSH密钥:
1、首先查看是否已经有了SSH密钥:
$ cd ~/.ssh
如果没有生成密钥,命令行中会提示没有.ssh
文件夹
2、接下来去生成密钥:
$ ssh-keygen -t rsa -C "email@example.com"
按3个回车,密码为空。
Your identification has been saved in /home/tekkub/.ssh/id_rsa.Your public key has been saved in /home/tekkub/.ssh/id_rsa.pub.The key fingerprint is:………………
(其中第一输入参数是设置生成文件名称,默认为空即可,下面的两个是设置密码使用,同样也为空即可)
最后得到了两个文件:id_rsa和id_rsa.pub,对应的文件在C:\Users\Administrator.ssh下
3、添加密钥到ssh:ssh-add 文件名(需要之前输入密码。)
4、打开github页面,在github页面中去设置SSH生成的密钥。操作步骤如下:
注意:接下来需要去配置公钥,也就是刚刚生成的id_rsa.pub文件中的内容。
将id_rsa.pub内容复制到github界面中对应key的位置即可,点击Add SSH key
按钮,接下来输入github的密码就大功告成。
5、测试:
$ ssh git@github.com The authenticity of host ‘github.com (207.97.227.239)’ can’t be established.RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added ‘github.com,207.97.227.239′ (RSA) to the list of known hosts.ERROR: Hi tekkub! You’ve successfully authenticated, but GitHub does not provide shell accessConnection to github.com closed.
当你看到Hi tekkub! You’ve successfully authenticated的时候说明已经配置成功,接下来就开始你的github之旅吧!
Git的项目创建
一、创建一个github项目
(在这里个人建议现在Github上先创建项目的目录工程,方便后面的代码提交工作)
1、在github页面中先创建一个项目目录出来,操作如下图:
2、添加远程仓库
3、上传文件到github
如果在git push origin master时报错(类似于:Updates were rejected because the remotecontains work that you do not have locally),说明远程仓库比本地仓库更新,要先执行git pull origin mater.
这样你的项目就已经上传至你的github上去了。
- Git SSH Key生成步骤说明
- Git SSH Key 生成步骤
- Git SSH Key 生成步骤
- Git SSH Key 生成步骤
- Git SSH Key 生成步骤
- Git SSH Key 生成步骤
- Git SSH Key 生成步骤
- Git SSH Key 生成步骤
- Git SSH Key 生成步骤
- Git SSH Key 生成步骤
- Git SSH Key 生成步骤
- Git SSH Key 生成步骤
- Git SSH Key 生成步骤
- Git SSH Key 生成步骤
- Git SSH Key 生成步骤
- Git SSH Key生成步骤
- Git SSH Key 生成步骤
- Git SSH Key 生成步骤
- ubuntu下安装nginx时依赖库zlib,pcre,openssl安装方法
- 数据挖掘十大算法--K-均值聚类算法
- [数位DP AC自动机] Codeforces 434C. Tachibana Kanade's Tofu
- [SPRD]展讯平台 LCD(Mipi) 加载流程分析
- Ehcache详细解读
- Git SSH Key生成步骤说明
- 懂得如何通过研究找到答案
- PAT (Basic Level) Practise (中文) 1030. 完美数列(25)
- 为什么很多做人脸的Paper会最后加入一个Local Connected Conv?
- mark
- [SPRD]展讯平台 LCD(Mipi)移植步骤及问题归纳
- CocoaPods: pod search 搜索类库失败的解决办法
- Java小程序之1000000数字判断是否为回数
- 保存退出vim编辑