创建 公钥/私钥 gpg --full-gen-key
gpg --full-gen-key
查看公钥列表 gpg --list-keys
gpg --list-keys
输出公钥内容 gpg --armor --export <公钥指纹> (指纹可以从上面的查看公钥列表中找)
gpg --armor --export <公钥指纹>
设置签名公钥 git config user.signingkey <公钥指纹>
如果加 --global代表全局设置 下同
每次提交自动使用签名 git config commit.gpgsign true
git config commit.gpgsign true
本次提交使用签名 git commit -S -m "My commit msg"
git commit -S -m "My commit msg"
查看提交记录的签名信息 git log --show-signature
git log --show-signature
导出公钥 gpg --armor -o public-file.key --export <公钥指纹>
gpg --armor -o public-file.key --export <公钥指纹>
导出私钥 gpg --armor -o private-file.key --export-secret-keys <公钥指纹>
gpg --armor -o private-file.key --export-secret-keys <公钥指纹>
--armor 的简写,表示密钥以ASCII的形式输出,默认以二进制的形式输出
导入(公钥或私钥) gpg --import xxxx.key
gpg --import xxxx.key
删除公钥和私钥 gpg --delete-secret-and-public-key <公钥指纹>
gpg --delete-secret-and-public-key <公钥指纹>
提交与检出均不转换LF和CRLF git config --global core.autocrlf false
git config --global core.autocrlf false
No dependencies set.
The note is not visible to the blocked user.
GPG
创建 公钥/私钥
gpg --full-gen-key查看公钥列表
gpg --list-keys输出公钥内容
gpg --armor --export <公钥指纹>(指纹可以从上面的查看公钥列表中找)
git提交签名
设置签名公钥
git config user.signingkey <公钥指纹>
每次提交自动使用签名
git config commit.gpgsign true本次提交使用签名
git commit -S -m "My commit msg"查看提交记录的签名信息
git log --show-signature导出公钥
gpg --armor -o public-file.key --export <公钥指纹>导出私钥
gpg --armor -o private-file.key --export-secret-keys <公钥指纹>导入(公钥或私钥)
gpg --import xxxx.key删除公钥和私钥
gpg --delete-secret-and-public-key <公钥指纹>提交与检出均不转换LF和CRLF
git config --global core.autocrlf false