Setting proxy Git
If you are working behind the proxies which requires authentication, usually all big companies uses proxies for user authentication where you will have to configure proxy. Here you will see how to do proxy setting for git repository:
- Open your command prompt
- Run the following commands replacing USERNAME, PASSWORD, PROXY_ADDRESS and PROXY_PORT with your company proxy server.
git config --global --add http.proxy http://USERNAME:PASSWORD$@PROXY_ADDRESS:PROXY_PORT git config --global --add https.proxy http://USERNAME:PASSWORD$@PROXY_ADDRESS:443 git config --global url."https://".insteadOf git:// git config --global url."https://github.com/".insteadOf git@github.com: git config --global http.sslverify false
- In some company you will have to include INTRANET/ before USERNAME. If above doesn’t works try below:
git config --global --add http.proxy http://intranet%5CUSERNAME:PASSWORD$@PROXY_ADDRESS:PROXY_PORT git config --global --add https.proxy http://intranet%5CUSERNAME:PASSWORD$@PROXY_ADDRESS:443 git config --global url."https://".insteadOf git:// git config --global url."https://github.com/".insteadOf git@github.com: git config --global http.sslverify false
Note: Don’t forget to replace special character to URL encoding. For example if your company adds intranet/ then it will be intranet%5C (%5C is URL encoding of /)
intranet/ = intranet%5C
Where will be location of above configuration: If your system is within corporate network where it uses personal drive the then location will be as below. Also please make sure you have identical copies exists on both the network drive (Your local drice C:\ and network drive F:\)
CORPORATE_PERSONAL_DRIVE\.gitconfig (F:\ and C:\Documents and Settings\USERNAME or C:\Users\USERNAME)