# 1/ check for previous keys (should not exists before the first time)
cd ~/.ssh #check for already existing pair of id_x and id_x.pub (id_rsa/id_edxxx/...)
# 2/ generate keys (if you dont have any) - pick one
#rsa
ssh-keygen -o
#ed algorithm (recommended)
ssh-keygen -t ed25519 -C you@mail.com
# 3/ add the key to the shh-agent
eval "$(ssh-agent -s)" #if the agent is running, it should return something like Agent pid 18544
sh-add ~/.ssh/id_ed25519 #or: ssh-add ~/.ssh/id_rsa
# 4/ copy the public key
cat ~/.ssh/id_ed25519.pub #or: cat ~/.ssh/id_rsa.pub
# copy all: ssh-ed25510...... you@mail.com or ssh-rsa....... you@mail.com
# 5/ past it to the github
# login - profile prefferences - ssh and gpg keys - new SSH key and paste 4/
# 6/ verify
ssh -v git@github.com
# if you got the following error:
# The authenticity of host 'github.com (ip)' can't be established.
# execute the following command and try again:
ssh-keyscan github.com >> ~/.ssh/known_hosts