Loading

Git 提交或打tag时对其进行GPG签名

给i他tag签名

git tag -a v0.3.3 HEAD -s -m "Release version 0.3.3"
git verify-tag v1.0.1
git push origin v1.0.1

看tag指向的对象类型

git cat-file -t v0.3.3

给commit签名

git commit -S -m "feat: xxx功能"
git log --show-signature -1

给【上一条已经提交好的 commit】补签名(还没 push 远程)

git commit --amend -S --no-edit

给历史多条旧 commit 批量补签名(交互式 rebase)

# 例如,从某个commit哈希之后全部重签
git rebase -i 你要处理的最早commit的上一个hash

验证 commit 签名

git log --show-signature
posted @ 2026-09-15 10:17  Outsrkem  阅读(6)  评论(0)    收藏  举报