Since Git 1.7.9 you can use credential helpers to cache in memory your password. You can modify the timeout period.

git config --global credential.helper "cache --timeout=3600"