作為一個Android愛好者膀捷,在git項目的時候經常會需要git墻外的項目比如下面這樣的。這時候就需要給git設置代理敛劝。參考文章
git clone https://android.googlesource.com/platform/packages/apps/Settings
前提
要給git設置代理丐黄,首先自己要有代理巍佑。我這次使用的是自己搭的vps茴迁。
設置
使用http或者https代理
git config --global https.proxy http://127.0.0.1:1080'
git config --global https.proxy 'https://127.0.0.1:1080'
或者使用sock5代理
git config --global https.proxy 'socks5://127.0.0.1:1080'
git config --global https.proxy 'socks5://127.0.0.1:1080'
取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy