Github Signed Commit

김지섭·2023년 6월 8일
0

GPG 설치

brew install gpg
brew install --cask gpg-suite

GPG 키 생성

gpg --full-generate-key

Please select what kind of key you want: 1
   
What keysize do you want? (3072) 4096

Key is valid for? (0)

생성된 키 확인

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
gpg: WARNING: server 'gpg-agent' is older than us (2.2.41 < 2.4.2)
gpg: Note: Outdated servers may lack important security fixes.
gpg: Note: Use the command "gpgconf --kill all" to restart them.
gpg: problem with fast path key listing: IPC parameter error - ignored
/Users/kimjisub/.gnupg/pubring.kbx
----------------------------------
sec   rsa4096/95B4246DB21323C9 2023-06-08 [SC]
      4DB28F187BD6E3E764C6B34195B4246DB21323C9
uid                 [ultimate] kimjisub (kimjisub) <0226daniel@gmail.com>
ssb   rsa4096/28EC34D06F622D68 2023-06-08 [E]

GPG Public Key Export

위에서 sec rsa4096/ 다음에 나오는 문자열을 입력한다.

gpg --armor --export 95B4246DB21323C9

위 명령어를 실행하여 나온 키를 복사하여 Github에 등록한다

Git에 GPG 등록

git config --global --unset gpg.format
git config --global user.signingkey 95B4246DB21323C9
git config --global gpg.program $(which gpg)
git config --global commit.gpgsign true

0개의 댓글