若是直連git遇到速度很慢,或者若是公司使用代理,git就須要設置代理才能克隆遠程倉庫git
執行下面兩條語句github
git config --global http.proxy 10.167.32.133:8080
git config --global https.proxy 10.167.32.133:8080ide
若是須要用戶名和密碼工具
git config –global http.proxy http://user:password@10.167.32.133:8080
git config –global http.proxy https://user:password@10.167.32.133:8080
spa
而後就能夠使用命令行
git clone http://github.com/videolan/vlc-3.0.git
# 或
git clone https://github.com/videolan/vlc-3.0.git代理
不能用code
git clone git@github.com:videolan/vlc-3.0.gitit
git config --system (或 --global 或 --local) --unset http.proxy
git config --system (或 --global 或 --local) --unset https.proxy程序
若是使用Github推出的桌面程序GitHub Desktop
,裏面可能並無代理設置的選項,不過這些客戶端通常在底層都是調用的命令行工具,因此一樣按照上述步驟進行設置便可。