Either because you set the env to domain.com:8888
and did not specify a port in the git config, or because you need to uppercase those env vars.
Also you do realize, that you can set git vars per repo? So you could do:
git init myrepo
cd myrepo
git config http.proxy "domain.com"
git remote add origin myremote
git fetch --all
git checkout -B master origin/master
And then only this repo would you the proxy.