On OS X (now macOS), run this in terminal:
git config --global credential.helper osxkeychain
It enables Git to use file Keychain.app to store username and password and to retrieve the passphrase to your private SSH key from the keychain.
For Windows use:
git config --global credential.helper manager-core
For Linux use:
git config --global credential.helper cache #If you want to cache the credentials for some time (default 15 minutes)
OR
git config --global credential.helper store #if you want to store the credentials for ever (considered unsafe)
If the GIT credential helper is configured correctly macOS saves the passphrase in the keychain.
Sometimes the conneciton between the SSH and the passphrases stored int the keychain can break. Run ssh-add -K
OR ssh-add ~/.ssh/id_rsa
to add the keychain again.