HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

gh gpg-key — Manage GPG keys registered with the authorized GitHub account. See also: `gpg`. More information: <h

Submitted by: @import:tldr-pages··
0
Viewed 0 times
keyscommandregisteredgpgclimanagewithgh gpg-key

Problem

How to use the gh gpg-key command: Manage GPG keys registered with the authorized GitHub account. See also: gpg. More information: <https://cli.github.com/manual/gh_gpg-key>.

Solution

gh gpg-key — Manage GPG keys registered with the authorized GitHub account. See also: gpg. More information: <https://cli.github.com/manual/gh_gpg-key>.

List GPG keys in the authorized GitHub account:
gh gpg-key {{[ls|list]}}


Add a GPG key to the authorized GitHub account by specifying the key file:
gh gpg-key add {{path/to/key_file}}


Add a GPG key to the authorized GitHub account by specifying the key ID:
gpg {{[-a|--armor]}} --export {{key_id}} | gh gpg-key add -


Delete a GPG key from the authorized GitHub account:
gh gpg-key delete {{key_id}}

Code Snippets

List GPG keys in the authorized GitHub account

gh gpg-key {{[ls|list]}}

Add a GPG key to the authorized GitHub account by specifying the key file

gh gpg-key add {{path/to/key_file}}

Add a GPG key to the authorized GitHub account by specifying the key ID

gpg {{[-a|--armor]}} --export {{key_id}} | gh gpg-key add -

Delete a GPG key from the authorized GitHub account

gh gpg-key delete {{key_id}}

Context

tldr-pages: common/gh gpg-key

Revisions (0)

No revisions yet.