Turn on the credential helper so that Git will save your password in memory for some time. By default, Git will cache your password for 15 minutes. In Terminal, enter the following:

$ git config --global credential.helper cache

for different repositories on github.com:

$ git config --global credential.helper store
$ git config --global credential.github.com.useHttpPath true