error: gpg failed to sign the data

fatal: failed to write commit object


killall gpg-agent


and then type the password again.



메뉴얼은 인터넷에 많으니, 경험을 끄적여 놓아 본다. , 이제 경험주의자에 기록주의자니까.


gpg 프로그램이 없으면

brew install gpg


gpg 키 만들기

gpg --full-generate-key


엔터치다가 엔터치고 막판에 O 치면 된다.


   (2) DSA and Elgamal

   (3) DSA (sign only)

   (4) RSA (sign only)

Your selection? 1

RSA keys may be between 1024 and 4096 bits long.

What keysize do you want? (2048)

Requested keysize is 2048 bits

Please specify how long the key should be valid.

         0 = key does not expire

      <n>  = key expires in n days

      <n>w = key expires in n weeks

      <n>m = key expires in n months

      <n>y = key expires in n years

Key is valid for? (0)

Key does not expire at all

Is this correct? (y/N) y


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


Real name: Junho

Email address: mynameis@hajunho.com

Comment:

You selected this USER-ID:

    "Junho <mynameis@hajunho.com>"


Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O



github에 등록할 키를 뽑아내려면, 등록한 이메일을 이용한다.


gpg --armor --export mynameis@hajunho.com

-----BEGIN PGP PUBLIC KEY BLOCK-----


mQENBFu7KQEBCADneTgQIsWBcbNiazoYekGIJ5yBjyrkMYpKecVmi7Rk949bW6Iy

2+SQyM6WCPjmOkmViMMYM4/rImDE4p/4nQAXcfkChHuvRxJmhUE3WUR1rQyVo57s

...


-----END PGP PUBLIC KEY BLOCK-----


이메일 말고 키 아이디를 이용할 수도 있다.

gpg --list-secret-keys --keyid-format LONG                           

sec   rsa2048/CD548CDB9E8CD4F1 2018-10-08 [SC]


처음 등록하고 나니 깃헙에서 unverified 로 나왔다.

GPG key ID: CD548CDB9E8CD4F1


이메일을 여러개 쓰고 있었는데 그 중 하나가 github에서 인증을 받지 않아서였다.

인증받고 나니 녹색 Verified 가 찍힌다. 다만 이미 commit 된 녀석은 바뀌지 않았다.

새롭게 commit 할 때만 Verified가 되었다.


그 외 몇가지.

Xcode에서 gpg 사이닝한 것이 commit이 잘되는데 sourceTree에서 되지 않았다.

그러나 소스트리에서 여는 터미널에서는 또 된다. 소스트리의 GUI가 gpg 관련 설정을 

오버라이드 하는 것 같은데, 여전히 내 repository 설정은 grey(disabled) 스택 오버 플로도 별 도움이 안되었다.

커밋은 항상 Xcode에서 하니 걍 내버려 둠.


글로벌은 모두 적용하고,

git config --global commit.gpgsign true

로컬은

git config commit.gpgsign false

적용 안하는 프로젝트가 생긴다. github외 따로 만들어 두는 git 저장소를 이용할 때 지원을 안해서 ㅠ


얜 뭔지 모르겠다.

export GPG_TTY=$(tty)


트러블 슈팅할 때 전혀 도움이 안되었다.

그에 반해 얜

GIT_TRACE=1 git commit -m "gpg test"

디버깅할 때 너무 좋았다.


git config --global gpg.program gpg

gpg도 있고 gpg1도 있는데 잘 설정하길.


요것도 잘 썼다.


$ git config user.email mynameis@hajunho.com

$ git commit --amend --reset-author

git commit --amend updates your last commits


그리고 trace 할 때 gpg1으로 잘했었는데 결국 gpg로 설정해서 잘되더라.

trace: run_command: gpg1 --status-fd=2 -bsau 'Junho HA <mynameis@hajunho.com>


7~8년 전 Email 담당할 때 gpg를 했었는데, 코어는 다 까먹고,

지금은 걍 깃헙의 Verified를 위해 툴 사용만 하는 수준이다.

sourceTree가 버전 업이 좀 되면 편리하게 지원하지 싶다.




'Objective-C, SQLite3' 카테고리의 다른 글

두번째 블로그의 마지막 글 모음  (0) 2019.02.05
About VCS  (0) 2019.02.05
github issue format  (0) 2019.02.05
인터넷 안되는 곳에서 강의 준비  (0) 2019.02.05
필카와 디카 차이  (0) 2019.02.04

+ Recent posts