From b51fba05fd0b85c4881e4628d3d16b3931ab741d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=9C=E9=B9=8F=E9=A3=9E?= Date: Mon, 8 Dec 2025 17:06:53 +0800 Subject: [PATCH] vault backup: 2025-12-08 17:06:53 --- .obsidian/plugins/home-tab/data.json | 14 +++++-------- .obsidian/workspace.json | 30 ++++++++++++++++++++-------- 技术探究/Git/GPG 签名.md | 30 ++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 17 deletions(-) create mode 100644 技术探究/Git/GPG 签名.md diff --git a/.obsidian/plugins/home-tab/data.json b/.obsidian/plugins/home-tab/data.json index 7a20a73..506803c 100644 --- a/.obsidian/plugins/home-tab/data.json +++ b/.obsidian/plugins/home-tab/data.json @@ -23,17 +23,13 @@ "markdownOnly": false, "unresolvedLinks": false, "recentFilesStore": [ + { + "filepath": "技术探究/Git/未命名.md", + "timestamp": 1765184458995 + }, { "filepath": "绿联 nas.md", - "timestamp": 1764814704464 - }, - { - "filepath": "各种项目/CBL/安装脚本.md", - "timestamp": 1764814694312 - }, - { - "filepath": "各种笔记.md", - "timestamp": 1764810697242 + "timestamp": 1765184442104 } ], "bookmarkedFileStore": [], diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json index 321144d..d9d539a 100644 --- a/.obsidian/workspace.json +++ b/.obsidian/workspace.json @@ -64,9 +64,23 @@ "icon": "lucide-file", "title": "绿联 nas" } + }, + { + "id": "9312fa7c58306877", + "type": "leaf", + "state": { + "type": "markdown", + "state": { + "file": "技术探究/Git/GPG 签名.md", + "mode": "preview", + "source": false + }, + "icon": "lucide-file", + "title": "GPG 签名" + } } ], - "currentTab": 2 + "currentTab": 3 }, { "id": "6ec03359aaeb2a06", @@ -282,7 +296,7 @@ "state": { "type": "search", "state": { - "query": "permission", + "query": "openp2p", "matchingCase": false, "explainSearch": true, "collapseAll": false, @@ -401,20 +415,20 @@ "state": { "type": "outline", "state": { - "file": "绿联 nas.md", + "file": "技术探究/Git/GPG 签名.md", "followCursor": false, "showSearch": false, "searchQuery": "" }, "icon": "lucide-list", - "title": "绿联 nas 的大纲" + "title": "GPG 签名 的大纲" } } ] } ], "direction": "horizontal", - "width": 773.5 + "width": 544.5 }, "left-ribbon": { "hiddenItems": { @@ -429,10 +443,11 @@ "obsidian-git:Open Git source control": false } }, - "active": "e6db84a5f04c915f", + "active": "9312fa7c58306877", "lastOpenFiles": [ - "各种项目/CBL/安装脚本.md", "绿联 nas.md", + "技术探究/Git/GPG 签名.md", + "各种项目/CBL/安装脚本.md", "各种笔记.md", "技术探究/GO/CGO.md", "技术探究/GO", @@ -464,7 +479,6 @@ "Users/tiangui/Desktop", "Users/tiangui", "Users", - "xxx.md", "未命名 5.base", "未命名 4.base", "测试/pages/folder6/images/微信图片_20220325105956.png", diff --git a/技术探究/Git/GPG 签名.md b/技术探究/Git/GPG 签名.md new file mode 100644 index 0000000..dd08560 --- /dev/null +++ b/技术探究/Git/GPG 签名.md @@ -0,0 +1,30 @@ +### 生成新密钥 +``` +gpg --full-generate-key +``` + +- 选择密钥类型:默认 `RSA and RSA`(按回车) +- 密钥长度:建议 `4096` +- 有效期:可以设为 `0`(永不过期)或指定年限 +- 输入你的 **真实姓名** 和 **邮箱地址**(必须与 Git 配置中的 user.email 一致!) + +### 查看已有的 GPG 密钥 +``` +gpg --list-secret-keys --keyid-format=long +``` + +###  Git 使用这个 GPG 密钥 +``` +git config --global user.signingkey xxx +``` + +### 配置 Git 默认签名提交 +``` +git config --global commit.gpgsign true +``` + +### 导出公钥并添加到 GitHub/GitLab 等平台 + +``` +gpg --armor --export xxxxx +``` \ No newline at end of file