Stacks on Stacks

Fixing git prompts for passphrase after upgrade to macOS Sierra

Recently, I took the plunge and upgraded from El Capitan to Sierra and kept getting prompts like the following every time I tried to do a git push or git pull:

Enter passphrase for key '/Users/my.user/.ssh/id_rsa':

I tried the standard method of adding the key to the ssh-agent with:

ssh-add -K ~/.ssh/id_rsa

However, every time I would open a new shell, I would get the same prompt for my passphrase again. Luckily, I was able to find the answer in a comment on StackOverflow:

  UseKeychain yes

This seems to have fixed the issue and I no longer have to deal with the incessant prompts for my passphrase.