PND*_*NDA 22 windows git github gnupg android-studio
根据这个链接,我只需要-S使用我的GPG密钥包含交换机来签署我的提交,但我不知道如何在Android Studio中使用它.
如何在Android Studio中签署我的提交?
编辑:我很欣赏OSX解决方案的出现,但我真的希望看到一个适用于Windows的答案.我只使用我的Mac作为文档和东西.
小智 5
进行一些测试后我按照这个步骤进行操作请按照以下步骤重新启动Android Studio:
你是否厌倦了为每次提交写密码?
之后编辑gpg.conf
nano~/.gnupg/gpg.conf
use-agent
no-tty
default-key <your key id>
Run Code Online (Sandbox Code Playgroud)
ln -s /usr/local/Cellar/libgcrypt/1.7.0_1/usr/local/opt/libgcrypt
ln -s /usr/local/Cellar/libgpg-error/1.22/usr/local/opt/libgpg-error
ln -s /usr/local/Cellar/libassuan/2.4.2/usr/local/opt/libassuan
ln -s /usr/local/Cellar/pth/2.0.7/usr/local/opt/pth
来源〜/ .profile
git commit -am"我的提交消息"-S
而已!!!
正如我在" 使用GPG签署git提交 "中提到的,使用Git 2.0:
如果要对所有提交进行GPG签名,则必须始终添加-S选项.
该commit.gpgsign配置选项允许签署所有自动提交.
但这并不完全有效,接下来是问题127802,其中包含以下变通方法:
使用该内容创建了一个帮助脚本:
/usr/bin/gpg –batch –no-tty "$@"
Run Code Online (Sandbox Code Playgroud)
并设置
gpg.program为该脚本
要么:
添加"
no-tty"到"~/.gnupg/gpg.conf"解决了我的问题.
您可能仍会收到错误消息:
Commit failed with error:
gpg: problem with the agent - disabling agent use
gpg: Sorry, no terminal at all requested - can't get input
error: gpg failed to sign the data
fatal: failed to write commit object
Run Code Online (Sandbox Code Playgroud)
再次:bug正在进行中,后面跟着问题110261:
除了之前的解决方案(OS X)之外,还要解决此问题:
1)
brew install gnupg gnupg2 pinentry-mac2)
nano ~/.gnupg/gpg-agent.conf- >pinentry-program /usr/local/bin/pinentry-mac3)
git config -–global gpg.program gpg2
| 归档时间: |
|
| 查看次数: |
1293 次 |
| 最近记录: |