본문 바로가기
coding/git

gqg로 git commit 하기

by 코딩희송 2022. 2. 8.
  • gqg 설치
$ brew install gpg
  • 사용할 이름과 이메일을 설정
$ gpg --gen-key gpg (GnuPG) 2.2.27; Copyright (C) 2021 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

Note: Use "gpg --full-generate-key" for a full featured key generation dialog.

GnuPG needs to construct a user ID to identify your key.

Real name: github user name  
Email address: [github@email.com](mailto:github@email.com)  
You selected this USER-ID:  
"github user name [github@email.com](mailto:github@email.com)"

Change (N)ame, (E)mail, or (O)kay/(Q)uit? O
  • 사용할 비밀번호 입력

비밀번호 입력하면 gqg 키가 생성됨.

We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
gpg: revocation certificate stored as '/Users/heesong/.gnupg/openpgp-revocs.d/E6A9CB763BBE8D469441028BC7B6E7D559CE827C.rev'
public and secret key created and signed.

pub   ed25519 2022-02-08 [SC] [expires: 2024-02-08]
      E6A9CB763BBE8D469441028BC7B6E7D559CE827C
uid                      poburi <shohom35@naver.com>
sub   cv25519 2022-02-08 [E] [expires: 2024-02-08]
  • git config 설정해주기
$ git config --global user.email github@email.com
$ git config --global user.name "github user name"
$ git config --global user.signingkey E6A9CB763BBE8D469441028BC7B6E7D559CE827C
$ git config --global commit.gpgsign true
$ git config --global gpg.program gpg
$ gpg --armor --export E6A9CB763BBE8D469441028BC7B6E7D559CE827C
$ export GPG_TTY=$(tty)
  • 커밋 시 비밀번호 주기 늘리기
# ~/.gnupg/gpg-agent.conf

default-cache-ttl 28800
max-cache-ttl 28800
  • 내보내기, 가져오기
$ gpg --list-secret-keys user@example.com
pub   4096R/ABC12345 2020-01-01 [expires: 2025-12-31]
uid                  Your Name <user@example.com>
sub   4096R/DEF67890 2020-01-01 [expires: 2025-12-31]
gpg --export-secret-keys YOUR_ID_HERE > private.key
gpg --import private.key

'coding > git' 카테고리의 다른 글

[Git] Submodule 서브모듈 사용하기  (0) 2021.04.20

댓글