git设置代理
对于github初学者,刚配置的环境可能会遇到各种坑,比如如果本地电脑使用的是公司网络,那有可能按照正常操作:去github上clone一个project的时候,就会提示
C:\myproject\vue01>git clone https://github.com/hemiahwu/vue-basic.gitCloning into 'vue-basic'...fatal: unable to access 'https://github.com/hemiahwu/vue-basic.git/': Couldn't resolve host 'github.com'
明明浏览器可以访问,但是为什么用git clone命令就是不行了呢。这个时候就有可能是因为本地电脑上有设置proxy,现在只需要配置一下git的proxy就可以了。打开CMD,按照以下格式输入,按回车,如果没有报错,应该就是设置好了。
git config --global https.proxy https://user:password@address:port
再试一下git clone,就可以正常运行了。
C:\myproject\vue01>git config --global http.proxy http://username:password@proxyserverhostname:portC:\myproject\vue01>git clone https://github.com/hemiahwu/vue-basic.gitCloning into 'vue-basic'...remote: Enumerating objects: 151, done.remote: Total 151 (delta 0), reused 0 (delta 0), pack-reused 151Receiving objects: 100% (151/151), 47.54 KiB | 0 bytes/s, done.Resolving deltas: 100% (58/58), done.
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。