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
來刪除設置。
