更新(2016年4月)
See “GitHub GPG signature verification”:
starting today GitHub will show you when commits and tags are signed.
When you view a signed commit or tag, you will see a badge indicating if the
signature could be verified using any of the contributor’s GPG keys uploaded
to GitHub.
You can upload your GPG keys by visiting thekeys settings
page.
原始答案(2014年6月)
通过编辑,您使用了“ Git恐怖故事:
带有签名提交的存储库完整性 ” 一文中的选项2 :
选项#2就像将-S参数传递给一样简单git merge。
如果合并是一个快进操作(也就是说,所有提交都可以简单地应用于
HEAD顶部而无需合并),那么您将需要使用该
–no-ff选项来强制执行合并提交。
然后做一个签名的请求拉(其中
的话可以随时签署commit.gpgsign的
设定)能够签署部分限制
将被合并为唯一的贡献,提交(而不是在提交
任何随机合并两个分支之间)。
有关该过程的更多详细信息,请参见:
- “How to use a signed tag in pull requests“
- ““Pulling signed tag” is already in use in the field“
- “Using a GPG Key to Sign-Off Git Commits and Emails” (for the gpg part)
因此,如果您的持续集成构建仅合并request-pull(在此测试脚本中使用),则可以检查这些特定的提交是否已签名(如果没有,则不要合并)。此脚本是此类检查的示例:“ check-commit- signature”。



