git的配置

git下载地址:

https://git-for-windows.github.io/

1.git配置:

git config --global user.name “Your Name”
git config --global user.email “email@example.com”

2.查看git配置:

git config --list


3.克隆git项目:

git clone https://github.com/Xibo-Yue/okhttputils.git

4.配置ssh:

   4.1查看是否已经有了ssh密钥:

  cd ~/.ssh
   如果没有密钥则不会有此文件夹,有则备份删除

   4.2生成ssh

   ssh-keygen -t rsa -C "你上一步配置的邮箱"

    按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(生成后会提示保存的路径,根据提示信息可以找到这两个路径)

    如果一切顺利的话,可以在用户主目录里找到.ssh目录,里面有id_rsa和id_rsa.pub两个文件,

这两个就是SSH Key的秘钥对,id_rsa是私钥,不能泄露出去,id_rsa.pub是公钥。


4.3 github配置

登陆GitHub,打开“settings”,选择“SSH and GPG keys”
点“New SSH Key”,填上任意Title,在Key文本框里粘贴id_rsa.pub文件的内容。 

添加后进行测试:

ssh git@github.com

会有如下提示:

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



  

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值