译自: https://www.linux.com/blog/learn/pgp/2018/3/protecting-code-integrity-pgp-part-6-using-pgp-git
作者: Konstantin Ryabitsev
译者: qhwdw
我们继续我们的 PGP 实践系列,来看看签名标签的标签和提交,这可以帮你确保你的仓库没有被篡改。
$ git config --global user.signingKey [fpr]
$ git config --global gpg.program gpg2
$ git tag -s [tagname]
$ git verify-tag [tagname]
$ git pull [url] tags/sometag
Merge tag 'sometag' of [url]
[Tag message]
# gpg: Signature made [...]
# gpg: Good signature from [...]
$ git config --global tag.forceSignAnnotated true
$ git tag -asm "Tag message" tagname
$ git commit -S
$ git verify-commit [hash]
$ git log --pretty=short --show-signature
$ git merge --verify-signatures -S merged-branch
git config --global commit.gpgSign true
# set to 30 minutes for regular ttl, and 2 hours for max ttl
default-cache-ttl 1800
max-cache-ttl 7200
enable-ssh-support
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
$ killall gpg-agent
$ bash
$ ssh-add -L
$ gpg --export-ssh-key [keyid]
欢迎光临 邳州信息网 (https://www.pzxxw.com/) | Powered by Discuz! X3.4 |