λ‘컬 컀λ°μμ GPGλ₯Ό μ¬μ©ν΄ Verified Commitμ νκΈ° μν μ€μ λ°©λ²
μ€μΉ
brew install gnupg pinentry-mac
ν€ μμ±
gpg --full-generate-key
μ λͺ
λ Ήμ΄ μ€ν ν μλ μ΅μ
μΌλ‘ μμ±
(1) RSA and RSA
keysize: 4096
0 = key does not expire
Real name: hyoguoo
Email address: hyoguoo@gmail.com
Comment:
μ΅μ
μ€μ μ λ§μΉλ©΄ μνΈλ₯Ό μ
λ ₯νλΌλ λ©μμ§κ° λμ€λλ°, μ΄ μνΈλ λμ€ λ¨κ³μμ μ΅μ΄ 컀λ°ν λ μ¬μ©λλ€.
μμ± λ ν€ νμΈ
gpg --list-secret-keys --keyid-format=long
gpg: checking the trustdb
gpg: marginals needed: 3 completes needed: 1 trust model: pgp
gpg: depth: 0 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 1u
/Users/hyogu/.gnupg/pubring.kbx
-------------------------------
sec rsa4096/A*************** 2023-04-25 [SC]
B***************************************
uid [ultimate] hyoguoo <hyoguoo@gmail.com>
ssb rsa4096/C*************** 2023-04-25 [E]
μμ κ° μ€ Aλ‘ μμνλ ν€κ° μλ κ³³μ΄ GPG Key ID
git config μ€μ
.gitconfig
νμΌμ μλμ λ΄μ© μΆκ°
[user]
name = hyoguoo
email = hyoguoo@gmail.com
signingkey = A***************
[commit]
gpgsign = true
[gpg]
program = gpg
GPG Agent μ€μ
pinentry
μ€μΉ μμΉ νμΈ
νμΈλλ μ€μΉ κ²½λ‘ /opt/homebrew/bin/pinentry-mac
κΈ°μ€ μλμ λͺ
λ Ήμ΄ μ€ν
echo "pinentry-program /opt/homebrew/bin/pinentry-mac" >> ~/.gnupg/gpg-agent.conf
GiHub ν€ λ±λ‘
gpg --armor --export A***************
-----BEGIN PGP PUBLIC KEY BLOCK-----
...
...
...
-----END PGP PUBLIC KEY BLOCK-----
μμ λͺ
λ Ήμ΄λ₯Ό μ€νν΄ GPG Key νμΈνλ©΄ μΆλ ₯λλ λ΄μ©(BEGIN ~ ENDκΉμ§)μ λ³΅μ¬ ν
GitHub - Settings - SSH and GPG keys - New GPG key
μμ 볡μ¬ν λ΄μ©μ λΆμ¬λ£κΈ° ν λ±λ‘
컀λ°
μ΅μ΄ μ»€λ° μ μμμ μ€μ ν λΉλ°λ²νΈ μ
λ ₯νλ©΄ Verified Commit
μ΄ λλ€.