赞
踩
一、http proxy | https proxy
git config --global http.proxy http://proxy.bizerba.com:8080
git config --global https.proxy https://proxy.bizerba.com:8080
unset proxy:
git config --global --unset http.proxy
git config --global --unset https.proxy
二、ssh proxy(access your own git repo like git@github.com:user/yourrepo.git)
!!! generate ssh key, and upload public key to github,make you be able clone your repo like:
git clone git@github.com:user/yourrepo.git
but if you are behind a proxy , you need to:
windows 10:
在.ssh文件夹下面新建config文件,内容如下:
- Host github.com
- ProxyCommand connect -H user_ip:user_port %h %p
- ForwardAgent yes
linux:
在.ssh文件夹下面新建config文件,内容如下:
- Host github.com
- ProxyCommand nc -X connect -x your_ip:your_port %h %p
- ServerAliveInterval 10
三、git proxy( optional to access git repo like git@github.com:user/yourrepo.git )
# step1: download socat | oe-git-proxy |
$ sudo apt-get install socat
$ wget http://git.yoctoproject.org/cgit/cgit.cgi/poky/plain/scripts/oe-git-proxy
$ cp oe-git-proxy ~/bin
$ chmod +x ~/bin/oe-git-proxy
# step2: modify proxy env
sudo vim .profile
export http_proxy=http://proxy.bizerba.com:xxxx
export https_proxy=https://proxy.bizerba.com:xxxx
export ftp_proxy=http://proxy.bizerba.com:xxxx
#export ALL_PROXY=socks://proxy.bizerba.com:xxxx
#export all_proxy=socks://proxy.bizerba.com:xxxx
export no_proxy=http://proxy.bizerba.com:xxxx
export GIT_PROXY_COMMAND="oe-git-proxy"
export NO_PROXY=$no_proxy
# step3: login
su - username
# step4: modify git proxy setting
git config --global core.gitproxy ~/bin/oe-git-proxy
其他思路:
git config --global url."https://".insteadOf git://
参考文献:
CMS Offline Software
Working Behind a Network Proxy - Yocto Project
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。