add signoff cli

Signed-off-by: daveberrys <daveberry@blueson.tech>
This commit is contained in:
daveberry committed 2026-11-12 17:11:08 +08:00
1 parent 793c8f1c00
commit ffea230f9a
4 files changed
+139 -12

No files matched your search

+24
View File
@@ -30,6 +30,7 @@
- [`logs`](#logs)
- [`pull`](#pull)
- [`push`](#push)
- [`signoff`](#signoff)
- [`stash`](#stash)
- [`undo`](#undo)
@@ -360,6 +361,29 @@ When `all` is given, pushes to every remote returned by `git remote`. The first
---
## `signoff`
Configure Git to sign commits with an SSH key.
```
guh signoff
```
Creates an ed25519 SSH key at `~/.ssh/id_ed25519` if one does not already exist, then configures Git with:
```
git config --global gpg.format ssh
git config --global user.signingkey ~/.ssh/id_ed25519.pub
git config --global commit.gpgsign true
```
If `~/.ssh/id_ed25519.pub` already exists and its comment matches your Git `user.email`, key generation is skipped and the existing key is reused. The command prints the public key so you can copy it, then opens `https://github.com/settings/ssh/new` in your browser.
> [!IMPORTANT]
> Add the key to GitHub as a **Signing Key**, not an **Authentication Key**.
---
## `stash`
Stash current working directory changes.