I know that it's very old question but if you really need to pass username and password for HTTP basic authentication you can just set helper like this:
git config credential.helper '!f() { sleep 1; echo "username=${GIT_USER}"; echo "password=${GIT_PASSWORD}"; }; f'
UPDATE: I've added sleep 1
to the function. In some environments it may be probably needed due to race condition. I've got 2 virtual machines running Debian Jessie. They had the same architecture but different CPU and different number of cores. On one of these machines the helper was working fine without sleep
. On the other one it wasn't. After few hours of debugging I run strace
to see what's happening. And it magically started to work. strace
just made git a little bit slower.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…