Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CentOS 7 下 Git 超时 #95

Open
XXHolic opened this issue Dec 25, 2020 · 0 comments
Open

CentOS 7 下 Git 超时 #95

XXHolic opened this issue Dec 25, 2020 · 0 comments

Comments

@XXHolic
Copy link
Owner

XXHolic commented Dec 25, 2020

引子

想要把 GitHub 的一个库弄到服务器上,使用 Git 克隆的时候,发现很慢或提示超时,想起来之前碰到过,这次记录一下。

系统:CentOS 7

解决方式

国内对 GitHub 的访问进行了限制,可以通过指定 IP 方式访问。

第一步:找 IP

首先找到 github.com 的 IP 地址,可以在 IPAddress 网站上查找。还可以添加 github.global.ssl.fastly.net 的映射,这个有助于加速。

注意:隔段时间地址会变,网上找的有些都过期了,建议还是自己去查询一下。

第二步:修改 host

vim /etc/hosts

将找到的最新地址映射添加到 hosts 中。

参考资料

🗑️

这样的爱情有什么不好呢

81-poster

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant