GitHub gpg体验

文档

实践

  • 生成新 GPG 密钥

    复制代码
    gpg --full-generate-key
  • 查看本地GPG列表

    复制代码
    gpg --list-keys
  • 关联GPG公钥与Github账户

    复制代码
    gpg --armor --export {key_id}


  • GPG私钥对Git commit进行签名

    复制代码
    git config --local user.signingkey {key_id}
    # git config --global user.signingkey {key_id}
    git commit -S -sm 'test gpg'
    # git config --global commit.gpgsign true 代替 -S
    git push
  • 在仓库查看签名git log --show-signature

注意事项

  • commit email 和 GPG邮箱要一致
  • 变基之后,GPG失效

相关推荐
减瓦1 天前
Windows 环境使用 Git Bash 最佳实践
windows·git
史呆芬1 天前
CodeX多仓库提交Skill搭建
git·后端·openai
城东1 天前
Git使用[原意要新建分支提交但是误提交到原来分支恢复办法]
git·原意要新建分支提交·但是误提交到原来分支
开发者联盟league1 天前
git 压缩本地最近多个commit
git
赵庆明老师1 天前
Vben精讲:04-了解VSCode中的Git
ide·git·vscode
Irissgwe2 天前
第 5 篇:Git 分支基础:branch、checkout、merge 和冲突解决
git
liberalhumblehopeful2 天前
git代码管理-分支差距过大如何进行同步
git
一只楚楚猫2 天前
一篇文章入门Git工具
git
Irissgwe2 天前
第 6 篇:Git 分支进阶:分支策略、stash、bugfix 和 feature 开发
git