git --ssh秘钥的使用

首先安装git Bash  

windowshttp://msysgit.github.io/

mac与linux 无需安装可直接使用  linux利用软件包

首先设置 姓名和邮箱地址

$ git config--globaluser.name"Firstname Lastname"

$ git config--globaluser.email"your_email@example.com"

这个命令会在~/.gitconfig 中输出为设置文件

提高 命令输出的可读性

$ git config--globalcolor.uiauto

设置SSH Key

$ ssh-keygen-t rsa-C"your_email@example.com"Generatingpublic/privatersa key pair.Enterfileinwhich to save the key

(/Users/your_user_directory/.ssh/id_rsa):按回车键Enterpassphrase(emptyfornopassphrase):输入密码Entersame passphrase again:再次输入密码

公钥的内容 会在~/.ssh/id_rsa.pub 出现

把公钥的内容添加到账户的 sshkeys管理中

链接 ssh

$ ssh-T git@github.com

Theauthenticity of host'github.com(207.97.227.239)'can't be established.

RSA key fingerprint is fingerprint值 .

Are you sure you want to continue connecting (yes/no)? 输入yes

出现以下结果 设置 成功

Hihirocastest!You've successfully authenticated, but GitHub does not provide shell access.

创建一个仓库 并设置 ssh方式


管理ssh keys



设置ssh方式
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容