向github 提交的时候报错,有人说在.ssh文件夹里新建config文件,有人说修改hosts文件。 我只选用其中一个方法没解决,两个一起用可以解决。
- 修改hosts文件, 末尾追加
C:\Windows\System32\drivers\etc\hosts
140.82.112.3 github.com\
140.82.114.4 gist.github.com\
185.199.108.153 assets-cdn.github.com\
199.232.68.133 raw.githubusercontent.com\
199.232.68.133 gist.githubusercontent.com\
199.232.68.133 cloud.githubusercontent.com\
199.232.68.133 camo.githubusercontent.com\
199.232.68.133 avatars0.githubusercontent.com\
199.232.68.133 avatars1.githubusercontent.com\
199.232.68.133 avatars2.githubusercontent.com\
199.232.68.133 avatars3.githubusercontent.com\
199.232.68.133 avatars4.githubusercontent.com\
199.232.68.133 avatars5.githubusercontent.com\
199.232.68.133 avatars6.githubusercontent.com\
199.232.68.133 avatars7.githubusercontent.com\
199.232.68.133 avatars8.githubusercontent.com\
- .shh文件夹新建config文件
Host github.com
User git
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443