Friday, April 1, 2016

Tangling with Git proxy settings in windows

To set up git proxy globally, you need to run this command

git config --global http.proxy "http://<your proxy>:<port>"

However, it returned me error,

error: could not lock config file H:\/.gitconfig: No such file or
directory error: could not lock config file
 
To fix it, need to set up the %HOME% environment variable to your user profile path

1. echo %userprofile%

2. create a new environment variable as HOME = the user profile directory

And then you can run the config http.proxy command.