日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

解决GitHub中头像显示异常、设置不了头像、README图片无法显示等问题

發布時間:2024/4/13 编程问答 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 解决GitHub中头像显示异常、设置不了头像、README图片无法显示等问题 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

解決GitHub中頭像顯示異常、設置不了頭像、README圖片無法顯示等問題

??很多時候在訪問 GitHub 官網時容易出現 GitHub 頭像顯示異常的問題。雖然這個問題無關痛癢,不過對于有強迫癥的人來說非解決不可。也有時候居然在設置中編輯不了頭像(編輯頭像的窗體一直加載不出。筆者曾經嘗試讓電腦加載一晚上,但是第二天醒來,發現編輯頭像的窗體還在顯示正在加載的轉圈動畫,真是不能忍了)。解決的辦法也很簡單。

??頭像顯示異常、設置不了頭像、README.md 中的圖片顯示裂圖等問題是解析外國網站域名超時所導致的。我們可以通過進行域名重定向來解決。域名重定向可以跳過對域名的解析而直接訪問其IP,這樣能盡量避免超時。

??域名重定向在文件 hosts(文件 hosts 位于 C:\Windows\System32\drivers\etc)里配置來實現。以文本方式打開文件 hosts(注意:文件 hosts 是一個沒有文件后綴的文件,不是文件 hosts.txt),在其添加以下內容:

# GitHub 開始 此右側域名的IP github.com 此右側域名的IP gist.github.com 此右側域名的IP assets-cdn.github.com 此右側域名的IP raw.githubusercontent.com 此右側域名的IP gist.githubusercontent.com 此右側域名的IP cloud.githubusercontent.com 此右側域名的IP camo.githubusercontent.com 此右側域名的IP avatars.githubusercontent.com 此右側域名的IP avatars0.githubusercontent.com 此右側域名的IP avatars1.githubusercontent.com 此右側域名的IP avatars2.githubusercontent.com 此右側域名的IP avatars3.githubusercontent.com 此右側域名的IP avatars4.githubusercontent.com 此右側域名的IP avatars5.githubusercontent.com 此右側域名的IP avatars6.githubusercontent.com 此右側域名的IP avatars7.githubusercontent.com 此右側域名的IP avatars8.githubusercontent.com 此右側域名的IP media.githubusercontent.com# GitHub 結束

??其中,“此右側域名的 IP”部分需要你自己將右側域名的正確 IP 換上。而域名可以通過在頁面代碼(頁面代碼可以在瀏覽器中的“開發人員工具”中查看)中獲取(光標在頁面代碼中移動可以定位圖片的域名)。那么,如何知道右側域名的正確 IP 呢?可以通過IP查詢網站: https://www.ipaddress.com/ 。使用此網站解析域名后,將 IP 替換到上述文本的相應的內容即可。另外要注意,域名的 IP 有可能以后會變化,因此要及時更新 hosts 文件的內容,否則以后某天 GitHub 官網會打不開。

??最后在 CMD 中輸入此命令 ipconfig /flushdns 來刷新 DNS 緩存,從而使上述文件 hosts 中的配置生效。


【附】一些關于 ipconfig 的命令:

  • 刷新 DNS 緩存:ipconfig /flushdns

  • 顯示 DNS 緩存:ipconfig /flushdns

  • 使用 DHCP 協議更新 IP:ipconfig /renew


??截止到 2021 年 3 月 10 日,上述的域名解析結果為:

# GitHub 開始 140.82.113.4 github.com 140.82.114.3 gist.github.com 185.199.108.153 assets-cdn.github.com 185.199.108.133 raw.githubusercontent.com 185.199.108.133 gist.githubusercontent.com 185.199.108.133 cloud.githubusercontent.com 185.199.108.133 camo.githubusercontent.com 185.199.108.133 avatars.githubusercontent.com 185.199.108.133 avatars0.githubusercontent.com 185.199.108.133 avatars1.githubusercontent.com 185.199.108.133 avatars2.githubusercontent.com 185.199.108.133 avatars3.githubusercontent.com 185.199.108.133 avatars4.githubusercontent.com 185.199.108.133 avatars5.githubusercontent.com 185.199.108.133 avatars6.githubusercontent.com 185.199.108.133 avatars7.githubusercontent.com 185.199.108.133 avatars8.githubusercontent.com 185.199.108.133 media.githubusercontent.com# GitHub 結束

??另外,使用 IP 查詢網站 https://www.ipaddress.com/ 查詢上述 IP 的快捷查詢網址為:

待查詢網址快捷查詢網址
github.comhttps://github.com.ipaddress.com/
gist.github.comhttps://github.com.ipaddress.com/gist.github.com
assets-cdn.github.comhttps://github.com.ipaddress.com/assets-cdn.github.com
raw.githubusercontent.comhttps://githubusercontent.com.ipaddress.com/raw.githubusercontent.com
gist.githubusercontent.comhttps://githubusercontent.com.ipaddress.com/gist.githubusercontent.com
cloud.githubusercontent.comhttps://githubusercontent.com.ipaddress.com/cloud.githubusercontent.com
camo.githubusercontent.comhttps://githubusercontent.com.ipaddress.com/camo.githubusercontent.com
avatars.githubusercontent.comhttps://githubusercontent.com.ipaddress.com/avatars.githubusercontent.com
avatars0.githubusercontent.comhttps://githubusercontent.com.ipaddress.com/avatars0.githubusercontent.com
avatars1.githubusercontent.comhttps://githubusercontent.com.ipaddress.com/avatars1.githubusercontent.com
avatars2.githubusercontent.comhttps://githubusercontent.com.ipaddress.com/avatars2.githubusercontent.com
avatars3.githubusercontent.comhttps://githubusercontent.com.ipaddress.com/avatars3.githubusercontent.com
avatars4.githubusercontent.comhttps://githubusercontent.com.ipaddress.com/avatars4.githubusercontent.com
avatars5.githubusercontent.comhttps://githubusercontent.com.ipaddress.com/avatars5.githubusercontent.com
avatars6.githubusercontent.comhttps://githubusercontent.com.ipaddress.com/avatars6.githubusercontent.com
avatars7.githubusercontent.comhttps://githubusercontent.com.ipaddress.com/avatars7.githubusercontent.com
avatars8.githubusercontent.comhttps://githubusercontent.com.ipaddress.com/avatars8.githubusercontent.com
media.githubusercontent.comhttps://githubusercontent.com.ipaddress.com/media.githubusercontent.com

總結

以上是生活随笔為你收集整理的解决GitHub中头像显示异常、设置不了头像、README图片无法显示等问题的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。