git credentials timeout

pushing to github after more than 20 min doesn't work. I think this is a timeout issue.
Added sh 'git config --global credential.helper "cache --timeout=3600"'
which is the accepted answer in http://stackoverflow.com/questions/5343068/is-there-a-way-to-skip-password-typing-when-using-https-github