如何在交互式变基压缩后保留提交 gpg 签名? [英] How to retain commit gpg-signature after interactive rebase squashing?

查看:30
本文介绍了如何在交互式变基压缩后保留提交 gpg 签名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我想通过交互式 rebase 压缩一些提交时:

When I want to squash some commits by interactive rebase:

git rebase -i HEAD~3

然后:

pick cbd03e3 Final commit (signed)
s f522f5d bla-bla-bla (signed)
s 09a7b7c bla-bla (signed)

# Rebase c2e142e..09a7b7c onto c2e142e
...

尽管所有这些提交都具有相同的签名,但最终提交没有 gpg 签名.交互式 rebase 压缩后是否可以保留提交 gpg 签名?

The final commit haven't gpg-signature despite that all of those commits have same signature. Is it possible to retain commit gpg-signature after interactive rebase squash?

推荐答案

就像 Cupcake 所说的,你不能保留未压缩提交的旧签名,但你可以签署新压缩提交,如果你像这样变基:

Like Cupcake stated, you can't retain the old signature from the unsquashed commits, but you can sign the new squashed commit if you rebase like this:

git rebase --interactive --gpg-sign=myemail@example.com HEAD~4

添加 --gpg-sign=myemail@example.com 作为参数将签署最终压缩提交.

Adding --gpg-sign=myemail@example.com as an argument will sign the final squashed commit.

这篇关于如何在交互式变基压缩后保留提交 gpg 签名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆