Git through proxy
06 Sep 2016I have to go through proxy at work. Time from time, I took a break and work on my personal projects which are hosted on github and thus, git on my computer needs to be configured for it.
On the terminal, run this :
<pre style="background-color: #eff0f1; border: 0px; color: #111111; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;"><div style="color: black; font-family: "Times New Roman"; font-size: medium; white-space: normal;">
HTTP_PROXY=http://proxy.site.my:80</div>
<div style="color: black; font-family: "Times New Roman"; font-size: medium; white-space: normal;">
git config –global http.proxy $HTTP_PROXY</div>
</pre>Back at home, I need to set it back to having no proxy
<pre style="background-color: #eff0f1; border: 0px; color: #111111; font-family: consolas, menlo, monaco, "lucida console", "liberation mono", "dejavu sans mono", "bitstream vera sans mono", "courier new", monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;"><div style="color: black; font-family: "Times New Roman"; font-size: medium; white-space: normal;">
git config –global –unset http.proxy</div>
</pre>Yeah, tedious.