When git CLI or clients such as SourceTree fail to use the macOS (FKA Mac OS X, OSX) Keychain to store authentication credentials, it may help to set the git configuration for the credential helper. Sometimes it's necessary to rerun this configuration command at a later date even after it's been run before to set the value that may have been unset or corrupted by some other program.
The command to use is:
git config --global credential.helper osxkeychain