Github SSH-Key

Assign private key

modify config in ~/.ssh/config.

1
2
3
4
5
6
7
# Github
Host *
AddKeysToAgent yes
UseKeychain yes
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_common

Switch protocol

Switch url from http type to ssh type in each repo.

1
2
3
4
# deprecated
url = http://github.com/Edlison/xxx.git
# approved
url = [email protected]:Edlison/xxx.git

Reference

https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent