Git repository `xxx.git` not found 问题
这两天,在家打开 Android Studio (Windows)突然发现,git
无法连上。
![](https://rmb.ee/wp-content/uploads/2022/05/2cd4e369-6b70-73e9-f8b8-1227d88c9e00.png)
然后试试挂科学,可以访问 github 网页,但是终端 git 命令依然还是提示 repository not found
。
再试 ping github.com
,发现 github 被解析到了 ::1
或 127.0.0.1
。
![](https://rmb.ee/wp-content/uploads/2022/05/2422ed44-6ecd-e5b3-1ad5-cfafd4a52665.png)
已知 C:\Windows\System32\drivers\etc\hosts
文件并没有对 github 作任何处理,由此猜测是被 dns 劫持了,所以修改 hosts 文件,指定 github 解析到的 ip。
![](https://rmb.ee/wp-content/uploads/2022/05/d2b5ca33-bd97-0f64-a630-1fa75ae2eb22-3.png)
执行 ipconfig /flushdns
后,发现 git 已经恢复正常。