20170824. github添加ssh-key

一、添加ssh-key

首先安装git,添加环境变量
1. 进入git bash

$ git config --global user.name "liu"
$ git config --global user.email "liuliuliu@126.com"

$ ssh-keygen -t rsa -C "liuliuliu@126.com"

按3次回车,则密码为空。

2. 在github网站上添加id_rsa.pub里的内容,默认地址C:\Users\user\.ssh

3. 测试之,显示这些内容即添加ssh-key成功

$ ssh git@github.com
The authenticity of host 'github.com (198.19.0.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,198.19.0.112' (RSA) to the list of known hosts.
PTY allocation request failed on channel 0
Hi liuliuliu! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.

        (您好,您验证成功,但是GitHub不提供shell访问。连接关闭。)

二、常用命令

cd wd
git clone git@github.com:liuliuliu/liu.git
cd liu
git pull
git status
git add *.*
git commit
git push

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值