本文介绍了更新MacOSX后,GPG签名Git提交,密码输入挂起的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为这是在我更新了最新的OSX版本(可能包含或未包含Git的新版本)之后开始发生的.但是现在,几乎每次我尝试签署自己的提交时(通过git commit -Sgit rebase -S):

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. 我收到密码提示
  2. 输入密码
  3. 按Enter键,没有任何反应.没有权限被拒绝:密码无效",什么也没有.
  4. 我必须按Ctrl-C才能退出提示.

不确定这是否是Git或El Capitan 10.11.6上的已知问题,但由于我总是在git commit上签名,因此它变得烦人.

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.

我还检查了是否没有其他GPG进程正在运行,什么也没有.

I've also checked that no other GPG processes are running and nothing.

推荐答案

我也像您一样被困在"您需要一个密码来为它解锁密钥"上,并且在将GPG与git一起使用时什么也没发生.

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.

解决方案是:

export GPG_TTY=$(tty)

它解决了问题,现在会要求您输入密码,并显示漂亮的提示.

It solves the problem and it'll now ask you for the password, with a beautiful prompt.

别忘了,将其添加到您的.bashrc(或.profile/.bash_profile)中:

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

这篇关于更新MacOSX后,GPG签名Git提交,密码输入挂起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 17:23
查看更多