為了避免 commit 被偽造,可以使用GPG簽名。
可參考以下文章:
https://help.github.com/articles/signing-commits/arrow-up-right
https://gist.github.com/Beneboe/3183a8a9eb53439dbee07c90b344c77earrow-up-right
https://docs.gitlab.com/ee/user/project/repository/gpg_signed_commits/arrow-up-right
可以看到下圖出現 Verified 圖樣
有時為 gpgagent 故障,可參考以下重啟
https://stackoverflow.com/a/66927472/4622645arrow-up-right
於 ~/.zshrc 加上
https://stackoverflow.com/questions/39494631/gpg-failed-to-sign-the-data-fatal-failed-to-write-commit-object-git-2-10-0arrow-up-right
Last updated 3 years ago
export GPG_TTY=$(tty)