These steps are necessary to get Git working with GitHub from behind a corporate firewall. These steps are for a Microsoft Windows centric environment.
Installing the Windows Git Package
Download the windows installer from http://git-scm.com then run the installer with the recommended default settings. You’ll need sufficient privileges to install applications at your desktop (condolences if you don’t).
Configure Git Proxy Settings
Locate the .gitconfig file in your users home directory and open with a text editor. If you have roaming profiles, it can be challenging to find this as it may be mapped to a shared network drive.
You can locate the file by identifying the home directory with the SET command in the DOS Command Window. In this example it happens to be on a network share mapped to the V: drive.
Make a note of your system Proxy Server settings here.
Looking at my .config file, there are six data points needed to configure git to be able to pass through my Proxy Server.
You can do this configuration from the command line with git configure –global but it feels simpler to just edit it here with your text editor.
- Your NTLM or Windows domain followed by a back slash (\), which has to be escaped so two slashes (\\)
- Your Windows Domain Username followed by a colon (:)
- Your Windows Domain Password (remember to escape any special characters) followed by an at sympol (@)
- Your Proxy Server address or hostname followed by a colon (:)
- Your Proxy Server TCP port number
- This turns off SSL Certificate verification as this proxy substitutes signed certificates with its own self-signed version. Presumably in order to allow admins to inspect what you’re transmitting!
String it all together and you get something like
Repeat these settings for the https directive below.
Setup a GitHub Repository
Go back to Github.com and create a new Repository. I’ve called mine Git_Setup.
Once it has bee created be sure to select the HTTP tab. If you fail to do this, instructions will assume you can perform outbound SSH from your host. Typical corporate Proxy and Firewall settings will deny this. So be sure to understand, you will be using Git over HTTPS through your Proxy Server.
You should then be able to perform the instructions identified in the red box from your Dos Command Window.
Seems to work for me…