> For the complete documentation index, see [llms.txt](https://anxiang1836.gitbook.io/ubuntu-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://anxiang1836.gitbook.io/ubuntu-guide/01-ubuntu-setting/02-git-speedup.md).

# git-clone加速

> 参考资料：<https://blog.51cto.com/11887934/2051323>

尝试了过用走代理来加速git，但是好像并没有成功，就还是用这种比较原始的方法来搞定吧。

## 前言

git clone（有些地区较快，有些地区较慢）；但总体来说,基本都在10KiB/s-40KiB/s之间。 作为linux运维人员来讲，经常需要在服务器上git clone；分享给大家个加速小办法，亲测有效！

## 设置

linux 修改host文件，将如下内容添加至hosts文件中： /etc/hosts

```
151.101.72.249 github.global.ssl.fastly.net  
192.30.253.112 github.com
```

如下图：

![](https://raw.githubusercontent.com/anxiang1836/FigureBed/master/img/20200505120619.png)

亲测，速度可以从几十K提升到MB的量级～～


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://anxiang1836.gitbook.io/ubuntu-guide/01-ubuntu-setting/02-git-speedup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
