Ubuntu16.04 github上下载速度慢 解决方法

首先有github和gitee账号
安装好git

user.name、 user.email:输入gitee账号密码

1.配置用户名
ckq@ckq:~/git$ git config --global user.name "。。。。。。。"
2.配置git邮箱
ckq@ckq:~/git$ git config --global user.email "。。。。。。。"


3.创建公钥
ckq@ckq:~/git$ ssh-keygen -C "邮箱。。。。" -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/ckq/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/ckq/.ssh/id_rsa.
Your public key has been saved in /home/ckq/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:。。。。。。。。。。。。。。。。。。。。。。。(删除)
The key's randomart image is:
+---[RSA 2048]----+
|.Eo              |
|o..o             |
| += o            |
|.=o+ +           |
|Bo..= . S        |
|**.+ + +         |
|Oo*oo.= .        |
|BBoo=. .         |
|+o*+             |
+----[SHA256]-----+

4.gitee添加公钥
将目录下的.ssh/id_rsa.pub里的内容全部复制。登录gitee网站在设置中选择SSH公钥添加公钥内容
ckq@ckq:~$ cd /home/ckq/.ssh/
ckq@ckq:~/.ssh$ ls
id_rsa  id_rsa.pub  known_hosts
ckq@ckq:~/.ssh$ cat id_rsa.pub 
...................
..............

。。。。。。。
将其复制到这里
这里

5.key加入到ssh-agent
ckq@ckq:~/git$ ssh-add ~/.ssh/id_rsa
Identity added: /home/ckq/.ssh/id_rsa (/home/ckq/.ssh/id_rsa)


6.初始化git仓库
ckq@ckq:~/git$ git init
Initialized empty Git repository in /home/ckq/git/.git/

7.测试一下SSH Key
ckq@ckq:~/git$ ssh -T git@gitee.com
The authenticity of host 'gitee.com ()' can't be established.
ECDSA key fingerprint is SHA256:...............................
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': yes
Warning: Permanently added 'gitee.com,' (ECDSA) to the list of known hosts.
Hi XXXXXXXXXX! You've successfully authenticated, but GITEE.COM does not provide shell access.


8.克隆项目代码
ckq@ckq:~/git$ git clone git@gitee.com:kaiqichen/FairMOT.git
Cloning into 'FairMOT'...
remote: Enumerating objects: 422, done.
remote: Counting objects: 100% (422/422), done.
remote: Compressing objects: 100% (205/205), done.
remote: Total 422 (delta 207), reused 422 (delta 207), pack-reused 0
Receiving objects: 100% (422/422), 62.98 MiB | 323.00 KiB/s, done.
Resolving deltas: 100% (207/207), done.
Checking connectivity... done.

clone 成功 速度比之前快了很多!!!!

Ubuntu16.04环境安装Git

参考学习

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值