GitHub SSH key
https://help.github.com/en/github/authenticating-to-github
steps
HTTPS clone !== SSH clone
https clone bug
SSH clone OK
testing
step 0. Checking for existing SSH keys
check
$ ls -al ~/.ssh
# id_rsa.pub
# id_ecdsa.pub
# id_ed25519.pub
$ cat ~/.ssh/id_rsa.pub
$ cat ~/.ssh/id_rsa
https://help.github.com/en/github/authenticating-to-github/checking-for-existing-ssh-keys
step 1. Generating a new SSH key
create
$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
step 2.
add
https://github.com/settings/ssh/new
step .3
將 SSH 密鑰添加到 ssh-agent
zh-Hans
$ eval "$(ssh-agent -s)"
# 修改 ~/.ssh/config 文件以自動將密鑰加載到 ssh-agent 中並在密鑰鏈中存儲密碼。
Host *
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_rsa
$ ssh-add -K ~/.ssh/id_rsa
step 4.test
$ ssh -T git@github.com
OK 👌
GPG key
https://help.github.com/articles/generating-a-gpg-key/