Stop SSH Asking for Your Key Passphrase on macOS

If SSH repeatedly asks for a key passphrase on macOS, add the key to the SSH agent and store its passphrase in the macOS Keychain:

ssh-add --apple-use-keychain ~/.ssh/keyname

To let SSH add and retrieve keys automatically, add this to ~/.ssh/config:

Host *
    AddKeysToAgent yes
    UseKeychain yes

ssh-add -K is the legacy macOS form of --apple-use-keychain.