GPG signing Git commits after updating MacOSX hangs on password entry

时光总嘲笑我的痴心妄想 提交于 2019-12-07 14:29:50

问题


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):

  1. I get the password prompt
  2. Enter the password
  3. Press enter and nothing happens. No 'Permission Denied: Invalid Password', nothing.
  4. 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.


回答1:


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!