[转] Git SSH Key 生成步骤

Git是分布式的代码管理工具,远程的代码管理是基于SSH的,所以要使用远程的Git则需要SSH的配置。

github的SSH配置如下:

一 、

设置Git的user name和email:

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

二、生成SSH密钥过程:
1.查看是否已经有了ssh密钥:cd ~/.ssh
如果没有密钥则不会有此文件夹,有则备份删除
2.生存密钥:

$ ssh-keygen -t rsa -C “[email protected]”
按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

3.添加密钥到ssh:ssh-add 文件名
需要之前输入密码。
4.在github上添加ssh密钥,这要添加的是“id_rsa.pub”里面的公钥。

打开https://github.com/ ,登陆xuhaiyan825,然后添加ssh。

5.测试:ssh [email protected]

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)? yes
Warning: 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 access
Connection to github.com closed.

三、 开始使用github
1.获取源码:

$ git clone [email protected]:billyanyteen/github-services.git

2.这样你的机器上就有一个repo了。
3.git于svn所不同的是git是分布式的,没有服务器概念。所有的人的机器上都有一个repo,每次提交都是给自己机器的repo
仓库初始化:

git init

生成快照并存入项目索引:

git add

文件,还有git rm,git mv等等…
项目索引提交:

git commit

4.协作编程:
将本地repo于远程的origin的repo合并,
推送本地更新到远程:

git push origin master

更新远程更新到本地:

git pull origin master

补充:
添加远端repo:

$ git remote add upstream git://github.com/pjhyett/github-services.git

重命名远端repo:

$ git://github.com/pjhyett/github-services.git为“upstream”
时间: 2024-08-11 09:57:45

[转] Git SSH Key 生成步骤的相关文章

Git SSH Key 生成步骤

Git是分布式的代码管理工具,远程的代码管理是基于SSH的,所以要使用远程的Git则需要SSH的配置. github的SSH配置如下: 一 . 设置Git的user name和email: $ git config --global user.name "your-name" $ git config --global user.email "your-email" 二.生成SSH密钥过程: 1.查看是否已经有了ssh密钥:cd ~/.ssh 如果没有密钥则不会有此

Git 中 SSH key 生成步骤

由于本地Git仓库和GitHub仓库之间的传输是通过SSH加密的,所以必须要让github仓库认证你SSH key,在此之前,必须要生成SSH key. 第1步:创建SSH Key.在windows下查看[c盘->用户->自己的用户名->.ssh]下是否有id_rsa.id_rsa.pub文件,如果没有需要手动生成.打开git bash,在控制台中输入以下命令. $ ssh-keygen -t rsa -C "[email protected]" 密钥类型可以用 -t

git ssh keys生成步骤

1.在github上面注册... 2.生成ssh密钥生成过程 1).查看是否已经有了ssh密钥: cd ~/.ssh 2).生成密钥 $ ssh-keygen -t rsa -C "[email protected]"  (注册github的邮箱账号) 回到github,进入Account Settings,左边选择SSH Keys,Add SSH Key,title随便填,粘贴key.为了验证是否成功,在git bash下输入: $ ssh -T [email protected]

git ssh key生成

重装系统后,需要重新安装git,ssh key便是遇到的其中一个问题,具体解决办法如下: 1.安装好git客户端后,查看本地是否有.ssh文件,命令如下:mkdir ~/.ssh 2.如果没有该文件,使用如下命令创建:mkdir ~/.ssh 3.配置全局的name和email:$ git config --global user.name "test"$ git config --global user.email "[email protected]" 4.生成

转:Git SSH Key 生成的步骤

一 .github的SSH配置如下: 设置Git的user name和email: $ git config --global user.name "XXX" $ git config --global user.email "[email protected]" 二.生成SSH密钥过程:1.查看是否已经有了ssh密钥:cd ~/.ssh如果没有密钥则不会有此文件夹,有则备份删除2.生存密钥: $ ssh-keygen -t rsa -C "[email 

Git ssh key生成并检测流程!

1.大致流程: 安装Git客户端工具 本地生成密钥对: 设置github或者GItLab上的公钥: 修改git的remote url为git协议(https不建议) git使用https协议,每次pull, push都要输入密码,使用git协议,使用ssh密钥.可以省去每次都输密码,但是一定要保管好自己的密钥,注意安全. 1.1)本地生成密钥对: ssh-keygen -t rsa -C "你的邮箱" 注意箭头密钥存放位置和密码 1.2)设置github或者GItLab上的公钥: gi

git使用ssh key认证步骤摘要

建议用Git Bash进行SSH生成及认证 1.看看~/.ssh目录下有无文件,有则直接跳至第三步. $ ls ~/.ssh 2.生成一个新的SSH key $ ssh-keygen -t rsa -C "[email protected]" 3.启动ssh代理(有两种方法,第一种不行,可以选第二种试试) $ ssh-agent -s 或者 $ eval `ssh-agent -s` 4.将key存入ssh代理 $ ssh-add ~/.ssh/id_rsa 5.将pub ssh ke

Gitblit Git 无密码 clone pull SSH Key 生成

部分内容参考自:http://blog.csdn.net/fenglailea/article/details/39317513 1.git基础配置 配置查看 git config --lis 用户名和邮箱,如果已填写过则PASS git config --global user.name "username" git config --global user.email "[email protected]" 2.生成SSH密钥(mysshkey是别名,可以任意)

git ssh key 配置 Ubuntu os

1.生成ssh key: ssh-keygen -t rsa -C “[email protected]” 此时,在~/.ssh/文件夹下会有两个文件, id_rsa 和 id_rsa.pub.分别保存ssh 的密钥和公钥. 2.把id_rsa.pub里面的内容复制到gitlab服务器内个人账号下的ssh_key部分. 3.在本地添加密钥: ssh-add ~/.ssh/id_rsa 这步在linux下似乎是必要的,不添加这步会导致识别不了账号密码.在windows下则不需要这一步. 4.从gi