我所做的:我在Github上创建了一个远程存储库,我试图在我的本地机器上克隆远程存储库。克隆时,我提供克隆URL和目标文件夹。
但每次我尝试克隆,我得到这个错误:
错误:“致命:无法访问https://github.com/hyperion057/spring-repo.git/':无法解决主机:github.com”
我需要做什么才能连接到GitHub ?
我所做的:我在Github上创建了一个远程存储库,我试图在我的本地机器上克隆远程存储库。克隆时,我提供克隆URL和目标文件夹。
但每次我尝试克隆,我得到这个错误:
错误:“致命:无法访问https://github.com/hyperion057/spring-repo.git/':无法解决主机:github.com”
我需要做什么才能连接到GitHub ?
当前回答
这里的边缘情况,但我尝试了(几乎)以上所有的答案在VirtualBox和什么都没有做,但然后关闭不仅VirtualBoxVM,但好ole VirtualBox本身和重新启动程序本身的技巧没有0抱怨。
希望可以帮助~0.1%的查询者:)
其他回答
我想说的是,当我做布莱恩的解时
git config --global --unset http.proxy
确保退出并重新启动终端。我的问题直到我这么做了才解决。
对于Ubuntu服务器,你可以在/etc/network/interfaces文件中写下路由器的essid和密码:
iface [en0 || your wireless driver no necessarily en0] inet static
address 192.168.1.100 / (something for your static ip between 1-255)
netmask 255.255.255.0
gateway 192.168.1.1 / (this is the ip of your router)
dns-nameservers 8.8.8.8 / (you can use whatever you want)
wpa-ssid qwertyuio / (this is router id)
wpa-psk qwertyuio / (this is router password for wireless connection)
当我在将存储库拉到服务器时遇到这个错误时,我编写了wpa-ssid和wpa-psk并重新启动。然后就成功了。
编辑:我又遇到了同样的问题,这一次是因为路由器信号电平不一致。我的联系不牢固,这就是问题所在。然而,上面的解决方案是静态ip的真正解决方案
我得到了类似的错误,这是由不正确的代理设置造成的。这个命令拯救了我:
git config --global --unset http.proxy
https版本:
git config --global --unset https.proxy
如果您的代理服务器没有用户名和密码-
像这样改变它-
192.168.49.1:8282 - <your-proxy-ip>:<端口>
git config ---global http.proxy 192.168.49.1:8282
git config ---global https.proxy 192.168.49.1:8282
重启后,git bash下面的工作对我来说很好:
git push -f origin master