问题
对于我们国内用户,有时候浏览器在进入github网站时,会出现无法加载或加载很慢的问题,针对这一问题,很是头疼,为解决这一问题,在网上搜索到的解决方法如下;
解决方案
- 修改hosts文件,在hosts文件中加入以下内容:
# GitHub Start# 针对无法加载或加载慢的问题192.30.253.112 github.com192.30.253.119 gist.github.com151.101.100.133 assets-cdn.github.com151.101.100.133 raw.githubusercontent.com151.101.100.133 gist.githubusercontent.com151.101.100.133 cloud.githubusercontent.com151.101.100.133 camo.githubusercontent.com151.101.100.133 avatars0.githubusercontent.com151.101.100.133 avatars1.githubusercontent.com151.101.100.133 avatars2.githubusercontent.com151.101.100.133 avatars3.githubusercontent.com151.101.100.133 avatars4.githubusercontent.com151.101.100.133 avatars5.githubusercontent.com151.101.100.133 avatars6.githubusercontent.com151.101.100.133 avatars7.githubusercontent.com151.101.100.133 avatars8.githubusercontent.com# 下载慢问题219.76.4.4 github-cloud.s3.amazonaws.com# GitHub End
- hosts文件所在目录
- Windows:
C:WindowsSystem32driversetchosts
- Linux:
etchosts
- 修改后生效方法
- 关机重启
- 断网重连
- Window:Win+R,输入cmd回车,然后在cmd窗口中输入:
ipconfig /flushdns
- Linux:Ctrl+Alt+T打开终端,输入
sudo rcnscd restart
问题
使用git同时同步github以及gitee;
解决方案
修改版本库.git/config
文件,在文件中加入github和gitee中对应版本库的url,如下例,将我github和gitee中PTA版本库url同时加入,然后在使用git就可以同时同步两端;
[core]repositoryformatversion = 0filemode = falsebare = falselogallrefupdates = truesymlinks = falseignorecase = true
[remote "origin"]url = https://gitee.com/cunyu1943/PTA.giturl = https://github.com/cunyu1943/PTA.gitfetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]remote = originmerge = refs/heads/master