git-credential-osxkeychain caches credentials in the secure keychain that's attached to your macOS system account. This method stores the credentials on disk, and they never expire, but they're encrypted with the same system that stores HTTPS certificates and Safari auto-fills. To use with all your repos: $ git config --global credential.helper osxkeychain