git 代理设置

Git 的代理设置也非常简单,一句话就搞定了:

git config --global http.proxy http://xxx:8080

git config --global http.proxy http://xxx:8080
 

如果需要用户名密码的话,则设置:

git config –global http.proxy http://user:password@http://10.10.10.10:8080 

其中 user 和 password 分别为你的用户名和密码。

设置完成后,可以通过如下命令来查看设置是否生效:

git config –get –global http.proxy

如果某一天你不喜欢她了,需要删除代理设置,那么可以使用:

git config --global (或 --local) --unset http.proxy
git config --global --unset http.proxy 

来删除设置。

posted @ 2017-02-10 15:52  孙佳敏  阅读(4871)  评论(0编辑  收藏  举报