git ssh 生成步骤

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”
时间: 2025-01-04 19:55:07

git ssh 生成步骤的相关文章

Git SSH生成

1.首先安装Git Bash\Git GUI 2.生成密钥: ssh-keygen -t rsa -C "[email protected]" 得到2个文件: id_rsa, id_rsa.pub 3.在github 或者oschina 添加ssh id_rsa.pub 测试:ssh [email protected]

git ssh 生成私钥和公钥

1.设置git的用户名和邮箱 git config --global user.name "toloy" git config --global user.email "[email protected]" 2.查看是否有ssh密钥 cd ~/.ssh 3.生成密钥 git-keygen -t rsa -C "[email protected]" 原文地址:https://www.cnblogs.com/toloy/p/8955321.html

转: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 生成步骤

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如果没有密钥则

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 Bash生成新的ssh key

使用Git Bash生成新的ssh key. $ cd ~  ///保证当前路径在"~"下 $ ssh-keygen -t rsa -C "你的邮箱地址"  ///建议填写自己真实有效的邮箱地址 结果: Enter file in which to save the key (/c/Users/xxxx_000/.ssh/id_rsa):   ///不填直接回车 Enter passphrase (empty for no passphrase):   ///输入密

Git 进阶指南(git ssh keys / reset / rebase / alias / submodule )

在掌握了基础的 Git 使用 之后,可能会遇到一些常见的问题.以下是猫哥筛选总结的部分常见问题,分享给各位朋友,掌握了这些问题的中的要点之后,git 进阶也就完成了,它包含以下部分: 如何修改 origin 仓库信息 如何配置 git ssh keys 如何撤销修改 遇到冲突了怎么解决 git stash / alias / submodule 的使用问题等 问:如何修改 origin 仓库信息? 1.添加 origin 仓库信息 git remote add origin <git仓库地址>

mac 安装并使用git下载代码步骤

1. 在mac电脑上安装git和xcode:从appstore直接下载即可: 2. 注册github账号 https://github.com/ -->Pricing and Signup -->Create a free account:如果是用于工作,可以直接用你的工作帐号去注册一个: 3. 创建ssh:创建这个目的是用于下载git代码 在local打开terminal: $cd -/.ssh  检查是否已经存在ssh 如果存在,先将已有的ssh备份,或者将新建的ssh生成到另外的目录下

SSH申请步骤

SSH - RSA的加密 >本地建立一个私钥,将公钥保存在服务器,设置之后,计算机有了身份验证. >再使用 git.oschina.com 就不用输入任何用户名或者密码的资料! 步骤: 1.点击个人-->SSH公钥-->怎样生成公钥 $ cd ~/.ssh # 生成私钥&公钥 $ ssh-keygen -t rsa -C "[email protected]" # 查看公钥内容 $ cat oschina_rsa.pub # 选中输出的内容 cmd+c,