GIt -- Window下配置 git

全局配置

  1.  git config --global user.name "账户名"
  2.  git config --global use r.email '账户邮箱'
  3. 生成ssh,命令: ssh-keygen -t rsa 

但是在window终端上ssh命令不能用,只能在Git安装目录下的打开git-bash.exe操作,步骤如下:

Git安装目录下,

找到 git-bash.exe

 输入:ssh-keygen -t rsa -C "email@xx.com"

Administrator /
$ ssh-keygen -t rsa -C "email@xx.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/Administrator/.ssh/id_rsa):  这里需要你输入一个密码(默认直接输入id_rsa文件名,或是直接回车),到会连接github需要用到

Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Passphrases do not match. Try again.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/Administrator/.ssh/id_rsa.
Your public key has been saved in /c/Users/Administrator/.ssh/id_rsa.pub.

然后到你的GIthub上创建ssh

 

然后再git-bush.exe,上输入以下命令:

# ssh git@github.com

然后 ,会出现 Enter passphrase for key '/c/Users/Administrator/.ssh/id_rsa':

叫你输入刚才生成sshkey 时,你输入的那个密码(我的是填id_rsa

出现以下情况,表示连接成功。

 

转载于:https://www.cnblogs.com/smallyi/p/8371319.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值