Skip to content

Instantly share code, notes, and snippets.

@channprj
Forked from simnalamburt/how-to-sign-commit.md
Created August 3, 2020 16:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save channprj/454f59c471a3384949b27c7970a197a0 to your computer and use it in GitHub Desktop.
Save channprj/454f59c471a3384949b27c7970a197a0 to your computer and use it in GitHub Desktop.

키베이스로 깃 커밋 서명하는법

A. PGP 공개키-비공개키 키쌍 등록

갖고있는 PGP 키쌍이 없을경우 새로 만들어야한다. 이미 키 쌍이 keybase에 업로드되어있는 경우, 기존의 키를 컴퓨터에 다운로드하기만 하면 된다.

A.1. 새 키 만들어서 하는법

keybase login

# 새 디바이스를 위한 새 PGP키를 생성
keybase pgp gen --multi

# 키 아이디를 복사
gpg --list-secret-keys

gpg --edit-key 0F85F46EE242057F
# gpg> uid 1
# gpg> trust
# Your decision? 5
# Do you really want to set this key to ultimate trust? (y/N) y
# gpg> save

A.2. 기존 키로 하는법

keybase login

# 어느 키를 사용할지 봄
keybase pgp list

# 키 파일로 내보냄
keybase pgp export -s -q 0F85F46EE242057F | gpg --import

A.3. keybase 없는 환경에서 하는법

# https://keybase.io 에서 비공개키를 export하여 파일로 저장

gpg --import private.key

B. .gitconfig 수정

[commit]
	gpgsign = true
[user]
	signingkey = 0F85F46EE242057F
References
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment