Friday, July 5, 2013

access github through proxy

In China mainland, you never know for what reason a website gets blocked by the fucking GFW. Even if the site has nothing to do with politics. github is a example, many developers in China are victims. This post is about how to access github via a proxy, such as goagent.
The git pull/push command can be instructed to access remote server via proxy by setting https_proxy environment variable. So, we can run commands below use proxy.
https_proxy=http://127.0.0.1:8087 git pull
or
export https_proxy=http://127.0.0.1:8087
git push
But we may get below error because the goagent ssl certificate can't be verified.
error: SSL certificate problem: unable to get local issuer certificate while accessing https://github.com/xxxxxxxxxxx
fatal: HTTP request failed
To resolve this problem, we can force git not to verify ssl ceritificate by setting GIT_SSL_NO_VERIFY environment variable.
export GIT_SSL_NO_VERIFY=true
git pull
To make these settings perminately for a git project or globally. We can write them to git config file.
git config http.proxy http://127.0.0.1:8087
git config http.sslVerify false
The resulting .git/config file is like this:
[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
    ignorecase = true
[remote "origin"]
    url = https://github.com/rxwen/my_posts.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master
[http]
    proxy = http://127.0.0.1:8087
    sslVerify = false
BTW, there is a rumour that Fang BingXing gets ill badly recently. Wish Death can conquer him as soon as possible, amen.

6 comments:

Anonymous said...

thanks,it is helpful.!

Anonymous said...

Thanks, Its very helpful.

Send Flower Pakistan said...

Hey everyone now I am telling you a way to open unblock torrent sites by using just simple click.
TorrentCrazy UK proxy

Unknown said...

If you're attempting to lose weight then you certainly have to start following this totally brand new personalized keto meal plan.

To design this service, licenced nutritionists, fitness trainers, and top chefs united to produce keto meal plans that are efficient, suitable, money-efficient, and satisfying.

Since their first launch in 2019, thousands of clients have already transformed their figure and well-being with the benefits a proper keto meal plan can offer.

Speaking of benefits: in this link, you'll discover 8 scientifically-certified ones provided by the keto meal plan.

Anonymous said...

Hi, read through this article, very informative. Great work there, I enjoyed evaluation through the whole blog. Here I also want to share some of the best USA VPS Hosting services for your website at a very cheap price.

Chaitanya said...

Great article bro. You have provide a great list of Blog directories. Thanks for sharing this with us.
RPA Training from Hyderabadg
Linux Admin Training from Hyderabadg
SAP GRC 11g and 12c Training from Hyderabadg