在为Git 2.2.0发行说明,它描述了一个新的选择git push
,--signed
:为什么Git需要签名推送?
"git push" learned "--signed" push, that allows a push (i.e.
request to update the refs on the other side to point at a new
history, together with the transmission of necessary objects) to be
signed, so that it can be verified and audited, using the GPG
signature of the person who pushed, that the tips of branches at a
public repository really point the commits the pusher wanted to,
without having to "trust" the server.
所以,它听起来就像推在数据被发送到服务器的签名,以便服务器可以验证并记录是谁推动的。在man
pages可以证实这一点:
--signed
GPG-sign the push request to update refs on the receiving side,
to allow it to be checked by the hooks and/or be logged. See
git-receive-pack[1] for the details on the receiving end.
你看在man
pages for git-receive-pack
下pre-receive
和post-recieve
钩,看看究竟如何验证签名的推动。
似乎所有这些都有助于服务器验证谁在进行推送的确实是他们所说的他们。
git push --signed
如何帮助您(推者)不必“信任”服务器?到目前为止我所见过的一切似乎都表明它可以帮助服务器信任你。更重要的是,为什么签名提交和签名标签不足以推送到不受信任的服务器?为什么我们甚至需要签名推送?