You can also set the HTTP proxy that Git uses in global configuration property http.proxy
:
git config --global http.proxy http://proxy.mycompany:80
To authenticate with the proxy:
git config --global http.proxy http://mydomain\\myusername:mypassword@myproxyserver:8080/
(Credit goes to @EugeneKulabuhov and @JaimeReynoso for the authentication format.)