I think this started happening after I updated the lastest OSX version, which might or might not have contained a new version of Git. But now, almost every time I try to sign my commits (either through git commit -S or git rebase -S):
- I get the password prompt
- Enter the password
- Press enter and nothing happens. No 'Permission Denied: Invalid Password', nothing.
- I have to Ctrl-C to get out of the prompt.
Not sure if this is a known issue on Git or El Capitan 10.11.6, but its getting vexing since I always sign my git commits.
I've also checked that no other GPG processes are running and nothing.
EDIT :
I was also stuck like you at "You need a passphrase to unlock secret key for" and nothing was happening when using GPG with git.
The solution is :
export GPG_TTY=$(tty)
It solves the problem and it'll now ask you for the password, with a beautiful prompt.
Don't forget to add it to your .bashrc (or .profile / .bash_profile) :
echo "export GPG_TTY=$(tty)" >> ~/.bashrc
source ~/.bashrc
Hope it will help you :)
来源:https://stackoverflow.com/questions/39517128/gpg-signing-git-commits-after-updating-macosx-hangs-on-password-entry