GPG 操作备忘 #7

Open
opened 2022-04-01 03:17:23 +00:00 by sookie · 3 comments
Owner

GPG

创建 公钥/私钥
gpg --full-gen-key

查看公钥列表
gpg --list-keys

输出公钥内容
gpg --armor --export <公钥指纹>
(指纹可以从上面的查看公钥列表中找)

git提交签名

设置签名公钥
git config user.signingkey <公钥指纹>

如果加 --global代表全局设置 下同

每次提交自动使用签名
git config commit.gpgsign true

本次提交使用签名
git commit -S -m "My commit msg"

### GPG 创建 公钥/私钥 `gpg --full-gen-key` 查看公钥列表 `gpg --list-keys` 输出公钥内容 `gpg --armor --export <公钥指纹>` (指纹可以从上面的查看公钥列表中找) ### git提交签名 设置签名公钥 git config user.signingkey <公钥指纹> > 如果加 --global代表全局设置 下同 每次提交自动使用签名 `git config commit.gpgsign true` 本次提交使用签名 `git commit -S -m "My commit msg"`
sookie added the
备份
label 2022-04-01 03:17:23 +00:00
Author
Owner

查看提交记录的签名信息
git log --show-signature

导出公钥
gpg --armor -o public-file.key --export <公钥指纹>

导出私钥
gpg --armor -o private-file.key --export-secret-keys <公钥指纹>

--armor 的简写,表示密钥以ASCII的形式输出,默认以二进制的形式输出

导入(公钥或私钥)
gpg --import xxxx.key

查看提交记录的签名信息 `git log --show-signature` 导出公钥 `gpg --armor -o public-file.key --export <公钥指纹>` 导出私钥 `gpg --armor -o private-file.key --export-secret-keys <公钥指纹>` > --armor 的简写,表示密钥以ASCII的形式输出,默认以二进制的形式输出 导入(公钥或私钥) `gpg --import xxxx.key`
Author
Owner

删除公钥和私钥
gpg --delete-secret-and-public-key <公钥指纹>

删除公钥和私钥 `gpg --delete-secret-and-public-key <公钥指纹>`
Author
Owner

提交与检出均不转换LF和CRLF
git config --global core.autocrlf false

提交与检出均不转换LF和CRLF `git config --global core.autocrlf false`
Sign in to join this conversation.
No Milestone
No project
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sookie/blog-web#7
No description provided.