常见git问题收录

常见git问题收录 目录


前言

  • 本文用于收录常见gitgithub问题

推荐阅读

  • 《Git权威指南》

1. 无法打开github

  1. 打开网站IP查询
  2. 输入www.github.com

在这里插入图片描述

  1. 打开C:\Windows\System32\drivers\etc下的hosts文件,在文件末尾增加52.74.223.119 www.github.com

在这里插入图片描述

  1. 打开cmd输入ipconfig /flushdns后,ping www.github.com获取如下图数据

在这里插入图片描述

  1. 可以打开github

2. github下载速度过慢

  1. 更换国内镜像源

比如,git clone github.com/xxx改成git clone github.com.cnpmjs.org/xxx

  1. 更改hostsbuffer

git config --global http.postBuffer 524288000

  1. 修改hosts
    1. 打开查询域名ip
    2. 寻找域名对应ip
    3. hosts文件内添加对应
151.101.72.249 github.global.ssl.fastly.net  
192.30.253.112 github.com

hosts文件位置:

  • winC:\Windows\System32\drivers\etc\hosts
  • linux/etc/hosts
  1. 码云作为中转站,中转文件

猜你喜欢

转载自blog.csdn.net/u013362192/article/details/114242966